Package com.cedarsoftware.io
Class JsonObject
java.lang.Object
com.cedarsoftware.io.JsonValue
com.cedarsoftware.io.JsonObject
This class holds a JSON object in a LinkedHashMap.
LinkedHashMap used to keep fields in same order as they are
when reflecting them in Java. Instances of this class hold a
Map-of-Map representation of a Java object, read from the JSON
input stream.
- Author:
- John DeRegnaucourt ([email protected])
Copyright (c) Cedar Software LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
License
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
Nested Class Summary
-
Field Summary
Fields inherited from class com.cedarsoftware.io.JsonValue
col, hintType, id, ID, isFinished, ITEMS, javaType, KEYS, line, REF, refId, SHORT_ID, SHORT_ITEMS, SHORT_KEYS, SHORT_REF, SHORT_TYPE, target, TYPE, VALUE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
Object[]
int
getValue()
int
hashCode()
boolean
hasValue()
boolean
isArray()
boolean
boolean
isEmpty()
boolean
isMap()
keySet()
void
setFinishedTarget
(Object o, boolean isFinished) void
setJsonArray
(Object[] jsonArray) void
int
size()
toString()
values()
Methods inherited from class com.cedarsoftware.io.JsonValue
getCol, getId, getJavaType, getJavaTypeName, getLine, getReferenceId, getTarget, hasId, isFinished, isReference, setFinished, setHintType, setId, setJavaType, setReferenceId, setTarget
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
JsonObject
public JsonObject()
-
-
Method Details
-
toString
-
setFinishedTarget
- Overrides:
setFinishedTarget
in classJsonValue
-
isMap
public boolean isMap() -
isCollection
public boolean isCollection() -
isArray
public boolean isArray() -
getJsonArray
-
setJsonArray
-
getLength
public int getLength() -
setValue
-
getValue
-
hasValue
public boolean hasValue() -
size
public int size() -
hashCode
public int hashCode() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKey
in interfaceMap<Object,
Object>
-
containsValue
- Specified by:
containsValue
in interfaceMap<Object,
Object>
-
get
-
remove
-
put
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-