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 Objectget(int i) Get the object at the given index.final PArraygetArray(int i) Get the element at the index as a json array.final booleangetBool(int i) Get the element as a boolean.final doublegetDouble(int i) Get the element at the index as a double.final floatgetFloat(int i) Get the element at the index as a float.final intgetInt(int i) Get the element at the index as an integer.final org.json.JSONArrayGet access to underlying array.final PJsonArraygetJSONArray(int i) Get the element at the index as a json array.final PJsonObjectgetJSONObject(int i) Get the element at the index as a json object.final longgetLong(int i) Get the element at the index as a long.final PObjectgetObject(int i) Get the element at the index as a json object.final StringgetString(int i) Get the element at the index as a string.final intsize()Return the size of the array.final StringtoString()Methods inherited from class org.mapfish.print.wrapper.PElement
addPathTo, getContextName, getCurrentPath, getParent, getPathMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:PArrayGet 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:PArrayGet the object at the given index. -
toString
-