Package org.mapfish.print.wrapper.json
Class PJsonArray
java.lang.Object
org.mapfish.print.wrapper.PElement
org.mapfish.print.wrapper.json.PJsonArray
- All Implemented Interfaces:
PArray
Wrapper around the
JSONArray
class to have a better error management.-
Constructor Summary
ConstructorsConstructorDescriptionPJsonArray
(PElement parent, org.json.JSONArray array, String contextName) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal Object
get
(int i) Get the object at the given index.final PArray
getArray
(int i) Get the element at the index as a json array.final boolean
getBool
(int i) Get the element as a boolean.final double
getDouble
(int i) Get the element at the index as a double.final float
getFloat
(int i) Get the element at the index as a float.final int
getInt
(int i) Get the element at the index as an integer.final org.json.JSONArray
Get access to underlying array.final PJsonArray
getJSONArray
(int i) Get the element at the index as a json array.final PJsonObject
getJSONObject
(int i) Get the element at the index as a json object.final long
getLong
(int i) Get the element at the index as a long.final PObject
getObject
(int i) Get the element at the index as a json object.final String
getString
(int i) Get the element at the index as a string.final int
size()
Return the size of the array.final String
toString()
Methods inherited from class org.mapfish.print.wrapper.PElement
addPathTo, getContextName, getCurrentPath, getParent, getPath
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.mapfish.print.wrapper.PArray
getCurrentPath, getPath
-
Constructor Details
-
PJsonArray
Constructor.- Parameters:
parent
- the parent object.array
- the array to wrapcontextName
- the name of this object within the parent.
-
-
Method Details
-
size
public final int size()Return the size of the array. -
getObject
Get the element at the index as a json object. -
getJSONObject
Get the element at the index as a json object.- Parameters:
i
- the index of the object to access
-
getArray
Get the element at the index as a json array. -
getJSONArray
Get the element at the index as a json array.- Parameters:
i
- the index of the element to access
-
getInt
public final int getInt(int i) Get the element at the index as an integer. -
getLong
public final long getLong(int i) Description copied from interface:PArray
Get the element at the index as a long. -
getFloat
public final float getFloat(int i) Get the element at the index as a float. -
getDouble
public final double getDouble(int i) Get the element at the index as a double. -
getString
Get the element at the index as a string. -
getInternalArray
public final org.json.JSONArray getInternalArray()Get access to underlying array. -
getBool
public final boolean getBool(int i) Get the element as a boolean. -
get
Description copied from interface:PArray
Get the object at the given index. -
toString
-