public class JSONObject extends JSON implements java.lang.Iterable<JSONObject.Property>
Modifier and Type | Class and Description |
---|---|
class |
JSONObject.Property |
Constructor and Description |
---|
JSONObject()
Creates a new, empty JSONObject.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(JSONVisitor v) |
JSONObject.Property |
getProperty(java.lang.String name)
Returns a property given its name.
|
JSON |
getPropertyValue(java.lang.String propertyName)
Returns the value associated to a given property.
|
java.util.Iterator<JSONObject.Property> |
iterator() |
boolean |
removeProperty(java.lang.String name)
Removes a property from the object given its name.
|
JSONObject |
setProperty(java.lang.String name,
JSON value)
Sets the value of a given property, eventually creating it when not
present.
|
public JSONObject setProperty(java.lang.String name, JSON value)
name
- value
- public boolean removeProperty(java.lang.String name)
name
- public JSONObject.Property getProperty(java.lang.String name)
name
- public JSON getPropertyValue(java.lang.String propertyName)
propertyName
- public void accept(JSONVisitor v)
public java.util.Iterator<JSONObject.Property> iterator()
iterator
in interface java.lang.Iterable<JSONObject.Property>