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 TypeMethodDescriptionbooleancontainsKey(String aKey) booleanUtility method, get the element with specified name without having to retreive the map first using getValue().getValue()inthashCode()protected StringConvert the JSON value into a string representation (JSON representation).intsize()strip()Remove all JSON related information.toString()
-
Field Details
-
map
-
-
Constructor Details
-
JSONObject
public JSONObject()
-
-
Method Details
-
size
public int size()- Specified by:
sizein classJSONComplex
-
getValue
-
toString
-
render
Description copied from class:JSONValueConvert 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.
-