Package org.mapfish.print.wrapper
Interface PObject
-
- All Known Implementing Classes:
PAbstractObject
,PJsonObject
,PMultiObject
,PYamlObject
public interface PObject
Object wrapper interface for Json and Yaml parsing.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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 value.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.
-
-
-
Method Detail
-
opt
java.lang.Object opt(java.lang.String key)
Get the value for the key.- Parameters:
key
- the key identifying the value to obtain.
-
getString
java.lang.String getString(java.lang.String key)
Get a property as a string or throw an exception.- Parameters:
key
- the property name
-
optString
java.lang.String optString(java.lang.String key)
Get a property as a string or null.- Parameters:
key
- the property name
-
optString
java.lang.String optString(java.lang.String key, java.lang.String defaultValue)
Get a property as a string or defaultValue.- Parameters:
key
- the property namedefaultValue
- the default value
-
getInt
int getInt(java.lang.String key)
Get a property as a int or throw an exception.- Parameters:
key
- the property name
-
optInt
java.lang.Integer optInt(java.lang.String key)
Get a property as a int or MIN_VALUE.- Parameters:
key
- the property name
-
optInt
java.lang.Integer optInt(java.lang.String key, java.lang.Integer defaultValue)
Get a property as a int or default value.- Parameters:
key
- the property namedefaultValue
- the default value
-
getLong
long getLong(java.lang.String key)
Get a property as a long or throw an exception.- Parameters:
key
- the property name
-
optLong
java.lang.Long optLong(java.lang.String key)
Get a property as a long or MIN_VALUE.- Parameters:
key
- the property name
-
optLong
long optLong(java.lang.String key, long defaultValue)
Get a property as a long or default value.- Parameters:
key
- the property namedefaultValue
- the default value
-
getDouble
double getDouble(java.lang.String key)
Get a property as a double or throw an exception.- Parameters:
key
- the property name
-
optDouble
java.lang.Double optDouble(java.lang.String key)
Get a property as a double or defaultValue.- Parameters:
key
- the property name
-
optDouble
java.lang.Double optDouble(java.lang.String key, java.lang.Double defaultValue)
Get a property as a double or defaultValue.- Parameters:
key
- the property namedefaultValue
- the default value
-
getFloat
float getFloat(java.lang.String key)
Get a property as a float or throw an exception.- Parameters:
key
- the property name
-
optFloat
java.lang.Float optFloat(java.lang.String key)
Get a property as a float or null.- Parameters:
key
- the property name
-
optFloat
java.lang.Float optFloat(java.lang.String key, java.lang.Float defaultValue)
Get a property as a float or Default value.- Parameters:
key
- the property namedefaultValue
- default value
-
getBool
boolean getBool(java.lang.String key)
Get a property as a boolean or throw exception.- Parameters:
key
- the property name
-
optBool
java.lang.Boolean optBool(java.lang.String key)
Get a property as a boolean or null.- Parameters:
key
- the property name
-
optBool
java.lang.Boolean optBool(java.lang.String key, java.lang.Boolean defaultValue)
Get a property as a boolean or default value.- Parameters:
key
- the property namedefaultValue
- the default
-
getObject
PObject getObject(java.lang.String key)
Get a property as a object or throw exception.- Parameters:
key
- the property name
-
optObject
PObject optObject(java.lang.String key)
Get a property as a object or null.- Parameters:
key
- the property name
-
optObject
PObject optObject(java.lang.String key, PObject defaultValue)
Get a property as a object or null.- Parameters:
key
- the property namedefaultValue
- default
-
getArray
PArray getArray(java.lang.String key)
Get a property as a array or throw exception.- Parameters:
key
- the property name
-
optArray
PArray optArray(java.lang.String key)
Get a property as a array or null.- Parameters:
key
- the property name
-
isArray
boolean isArray(java.lang.String key)
Is the property an array.- Parameters:
key
- the property name
-
optArray
PArray optArray(java.lang.String key, PArray defaultValue)
Get a property as a array or default.- Parameters:
key
- the property namedefaultValue
- default
-
keys
java.util.Iterator<java.lang.String> keys()
Get an iterator of all keys in this objects.- Returns:
- The keys iterator
-
size
int size()
Get the number of properties in this object.
-
has
boolean has(java.lang.String key)
Check if the object has a property with the key.- Parameters:
key
- key to check for.
-
getPath
java.lang.String getPath(java.lang.String key)
Gets the string representation of the path to the current element.- Parameters:
key
- the leaf key
-
getCurrentPath
java.lang.String getCurrentPath()
Gets the string representation of the path to the current element.
-
-