Package com.cedarsoftware.util.io
Class JsonObject
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<Object,
Object>
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
http://www.apache.org/licenses/LICENSE-2.0
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.* - See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
boolean
Object[]
getArray()
Class<?>
int
Class<?>
getValue()
int
hashCode()
boolean
hasId()
A JsonObject starts off with an id of -1.boolean
isArray()
boolean
boolean
boolean
boolean
isMap()
boolean
setFinishedTarget
(Object o, boolean isFinished) int
size()
toString()
Methods inherited from class java.util.LinkedHashMap
containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, values
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, putAll, putIfAbsent, remove, remove, replace, replace
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, putAll, putIfAbsent, remove, remove, replace, replace
-
Field Details
-
KEYS
- See Also:
-
ITEMS
- See Also:
-
ID
- See Also:
-
REF
- See Also:
-
TYPE
- See Also:
-
SHORT_TYPE
- See Also:
-
SHORT_ITEMS
- See Also:
-
SHORT_KEYS
- See Also:
-
SHORT_ID
- See Also:
-
SHORT_REF
- See Also:
-
VALUE
- See Also:
-
-
Constructor Details
-
JsonObject
public JsonObject()
-
-
Method Details
-
toString
- Overrides:
toString
in classAbstractMap<Object,
Object>
-
hasId
public boolean hasId()A JsonObject starts off with an id of -1. Also, an id of 0 is not considered a valid id. It must be 1 or greater. JsonWriter utilizes this fact. -
isFinished
public boolean isFinished() -
setFinishedTarget
-
getTargetClass
-
isLogicalPrimitive
public boolean isLogicalPrimitive() -
getPrimitiveValue
-
isReference
public boolean isReference()- Returns:
- boolean true if this object references another object, false otherwise.
-
getReferenceId
-
isMap
public boolean isMap() -
isCollection
public boolean isCollection() -
isArray
public boolean isArray() -
getArray
-
getLength
public int getLength() -
getComponentType
-
put
-
setValue
-
getValue
-
clear
public void clear() -
size
public int size() -
hashCode
public int hashCode() -
equals
-