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, ENUM, id, ID, isFinished, ITEMS, 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()
boolean
Object[]
getItems()
Object[]
getKeys()
int
Deprecated.Use size() instead.getValue()
int
hashCode()
boolean
hasValue()
boolean
isArray()
boolean
boolean
isEmpty()
boolean
isMap()
keySet()
void
void
void
int
size()
toString()
values()
Methods inherited from class com.cedarsoftware.io.JsonValue
getCol, getId, getJavaType, getLine, getRawType, getRawTypeName, getReferenceId, getTarget, getType, hasId, isFinished, isReference, setFinished, setFinishedTarget, setId, setJavaType, setReferenceId, setTarget, setType
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
JsonObject
public JsonObject()
-
-
Method Details
-
toString
-
isMap
public boolean isMap() -
isCollection
public boolean isCollection() -
isArray
public boolean isArray() -
getItems
-
setItems
-
getKeys
-
size
public int size() -
getLength
Deprecated.Use size() instead. This method will be removed in a future release. -
setValue
-
getValue
-
hasValue
public boolean hasValue() -
hashCode
public int hashCode() -
equals
-
isEmpty
public boolean isEmpty() -
remove
-
put
-
putAll
-
clear
public void clear() -
containsKey
- Specified by:
containsKey
in interfaceMap<Object,
Object>
-
containsValue
- Specified by:
containsValue
in interfaceMap<Object,
Object>
-
get
-
keySet
-
values
-
entrySet
-