Package com.sdicons.json.model
Class JSONObject
java.lang.Object
com.sdicons.json.model.JSONValue
com.sdicons.json.model.JSONComplex
com.sdicons.json.model.JSONObject
Representation of a JSON object, a collection (unordered) of name/value pairs.
An example:
{"name":"Homer", "age":40, "children":["Bart", "Maggie", "Lisa"]}
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKey
(String aKey) boolean
Utility method, get the element with specified name without having to retreive the map first using getValue().getValue()
int
hashCode()
protected String
Convert the JSON value into a string representation (JSON representation).int
size()
strip()
Remove all JSON related information.toString()
-
Field Details
-
map
-
-
Constructor Details
-
JSONObject
public JSONObject()
-
-
Method Details
-
size
public int size()- Specified by:
size
in classJSONComplex
-
getValue
-
toString
-
render
Description copied from class:JSONValue
Convert the JSON value into a string representation (JSON representation). -
equals
-
hashCode
public int hashCode() -
containsKey
-
get
Utility method, get the element with specified name without having to retreive the map first using getValue().- Parameters:
aKey
- The key for which you want to retrieve the element.- Returns:
- The element corresponding to the key or null if the object does not contain a key with this name.
-
strip
Remove all JSON related information. In the case of a JSONObject, a HashMap is returned. The values of the HashMap are stripped as well.
-