public interface PObject
| Modifier and Type | Method and Description |
|---|---|
PArray |
getArray(java.lang.String key)
Get a property as a array or throw exception.
|
boolean |
getBool(java.lang.String key)
Get a property as a boolean or throw exception.
|
java.lang.String |
getCurrentPath()
Gets the string representation of the path to the current element.
|
double |
getDouble(java.lang.String key)
Get a property as a double or throw an exception.
|
float |
getFloat(java.lang.String key)
Get a property as a float or throw an exception.
|
int |
getInt(java.lang.String key)
Get a property as a int or throw an exception.
|
long |
getLong(java.lang.String key)
Get a property as a long or throw an exception.
|
PObject |
getObject(java.lang.String key)
Get a property as a object or throw exception.
|
java.lang.String |
getPath(java.lang.String key)
Gets the string representation of the path to the current element.
|
java.lang.String |
getString(java.lang.String key)
Get a property as a string or throw an exception.
|
boolean |
has(java.lang.String key)
Check if the object has a property with the key.
|
boolean |
isArray(java.lang.String key)
Is the property an array.
|
java.util.Iterator<java.lang.String> |
keys()
Get an iterator of all keys in this objects.
|
java.lang.Object |
opt(java.lang.String key)
Get the value for the key.
|
PArray |
optArray(java.lang.String key)
Get a property as a array or null.
|
PArray |
optArray(java.lang.String key,
PArray defaultValue)
Get a property as a array or default.
|
java.lang.Boolean |
optBool(java.lang.String key)
Get a property as a boolean or null.
|
java.lang.Boolean |
optBool(java.lang.String key,
java.lang.Boolean defaultValue)
Get a property as a boolean or default value.
|
java.lang.Double |
optDouble(java.lang.String key)
Get a property as a double or defaultValue.
|
java.lang.Double |
optDouble(java.lang.String key,
java.lang.Double defaultValue)
Get a property as a double or defaultValue.
|
java.lang.Float |
optFloat(java.lang.String key)
Get a property as a float or null.
|
java.lang.Float |
optFloat(java.lang.String key,
java.lang.Float defaultValue)
Get a property as a float or Default vaule.
|
java.lang.Integer |
optInt(java.lang.String key)
Get a property as a int or MIN_VALUE.
|
java.lang.Integer |
optInt(java.lang.String key,
java.lang.Integer defaultValue)
Get a property as a int or default value.
|
java.lang.Long |
optLong(java.lang.String key)
Get a property as a long or MIN_VALUE.
|
long |
optLong(java.lang.String key,
long defaultValue)
Get a property as a long or default value.
|
PObject |
optObject(java.lang.String key)
Get a property as a object or null.
|
PObject |
optObject(java.lang.String key,
PObject defaultValue)
Get a property as a object or null.
|
java.lang.String |
optString(java.lang.String key)
Get a property as a string or null.
|
java.lang.String |
optString(java.lang.String key,
java.lang.String defaultValue)
Get a property as a string or defaultValue.
|
int |
size()
Get the number of properties in this object.
|
java.lang.Object opt(java.lang.String key)
key - the key identifying the value to obtain.java.lang.String getString(java.lang.String key)
key - the property namejava.lang.String optString(java.lang.String key)
key - the property namejava.lang.String optString(java.lang.String key,
java.lang.String defaultValue)
key - the property namedefaultValue - the default valueint getInt(java.lang.String key)
key - the property namejava.lang.Integer optInt(java.lang.String key)
key - the property namejava.lang.Integer optInt(java.lang.String key,
java.lang.Integer defaultValue)
key - the property namedefaultValue - the default valuelong getLong(java.lang.String key)
key - the property namejava.lang.Long optLong(java.lang.String key)
key - the property namelong optLong(java.lang.String key,
long defaultValue)
key - the property namedefaultValue - the default valuedouble getDouble(java.lang.String key)
key - the property namejava.lang.Double optDouble(java.lang.String key)
key - the property namejava.lang.Double optDouble(java.lang.String key,
java.lang.Double defaultValue)
key - the property namedefaultValue - the default valuefloat getFloat(java.lang.String key)
key - the property namejava.lang.Float optFloat(java.lang.String key)
key - the property namejava.lang.Float optFloat(java.lang.String key,
java.lang.Float defaultValue)
key - the property namedefaultValue - default valueboolean getBool(java.lang.String key)
key - the property namejava.lang.Boolean optBool(java.lang.String key)
key - the property namejava.lang.Boolean optBool(java.lang.String key,
java.lang.Boolean defaultValue)
key - the property namedefaultValue - the defaultPObject getObject(java.lang.String key)
key - the property namePObject optObject(java.lang.String key)
key - the property namePObject optObject(java.lang.String key, PObject defaultValue)
key - the property namedefaultValue - defaultPArray getArray(java.lang.String key)
key - the property namePArray optArray(java.lang.String key)
key - the property nameboolean isArray(java.lang.String key)
key - the property namePArray optArray(java.lang.String key, PArray defaultValue)
key - the property namedefaultValue - defaultjava.util.Iterator<java.lang.String> keys()
int size()
boolean has(java.lang.String key)
key - key to check for.java.lang.String getPath(java.lang.String key)
key - the leaf keyjava.lang.String getCurrentPath()