Interface JsonArray
- All Superinterfaces:
JsonValue
Represents a Json array. Abstracted from javax.json (J2EE) and Jersey.
- Author:
- Holger Eichelberger, SSE
-
Method Summary
Modifier and TypeMethodDescriptionbooleangetBoolean(int index) Returns the boolean value at the specified position.intgetInt(int index) Returns the int value at the specified position.getJsonArray(int index) Returns the arrray value at the specified position in this array.getJsonNumber(int index) Returns the number value at the specified position in this array.getJsonObject(int index) Returns the object value at the specified position in this array.getJsonString(int index) Returns the string value at the specified position in this array.getString(int index) Returns the string value at the specified position.getValue(int index) Returns the element at the specified position in this list.booleanisEmpty()Returnstrueif this array contains no elements.booleanisNull(int index) Returnstrueif the value at the specified location in this array is Json null.intsize()Returns the number of elements in this array.Methods inherited from interface de.iip_ecosphere.platform.support.json.JsonValue
asJsonObject
-
Method Details
-
size
int size()Returns the number of elements in this array. If this array contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.- Returns:
- the number of elements in this array
-
getJsonObject
Returns the object value at the specified position in this array.- Parameters:
index- index of the value to be returned- Returns:
- the value at the specified position in this array
- Throws:
IndexOutOfBoundsException- if the index is out of rangeClassCastException- if the value at the specified position is not assignable to theJsonObjecttype
-
getJsonArray
Returns the arrray value at the specified position in this array.- Parameters:
index- index of the value to be returned- Returns:
- the value at the specified position in this array
- Throws:
IndexOutOfBoundsException- if the index is out of rangeClassCastException- if the value at the specified position is not assignable to theJsonArraytype
-
getJsonNumber
Returns the number value at the specified position in this array.- Parameters:
index- index of the value to be returned- Returns:
- the value at the specified position in this array
- Throws:
IndexOutOfBoundsException- if the index is out of rangeClassCastException- if the value at the specified position is not assignable to theJsonNumbertype
-
getJsonString
Returns the string value at the specified position in this array.- Parameters:
index- index of the value to be returned- Returns:
- the value at the specified position in this array
- Throws:
IndexOutOfBoundsException- if the index is out of rangeClassCastException- if the value at the specified position is not assignable to theJsonStringtype
-
getString
Returns the string value at the specified position.- Parameters:
index- index of the JSON string value- Returns:
- the string value at the specified position
- Throws:
IndexOutOfBoundsException- if the index is out of rangeClassCastException- if the value at the specified position is not assignable
-
getInt
int getInt(int index) Returns the int value at the specified position.- Parameters:
index- index of the JSON int value- Returns:
- the int value at the specified position
- Throws:
IndexOutOfBoundsException- if the index is out of rangeClassCastException- if the value at the specified position is not assignable
-
getBoolean
boolean getBoolean(int index) Returns the boolean value at the specified position.- Parameters:
index- index of the JSON boolean value- Returns:
- the boolean value at the specified position
- Throws:
IndexOutOfBoundsException- if the index is out of rangeClassCastException- if the value at the specified position is not assignable
-
getValue
Returns the element at the specified position in this list.- Parameters:
index- index of the element to return- Returns:
- the element at the specified position in this list
- Throws:
IndexOutOfBoundsException- - if the index is out of range
-
isEmpty
boolean isEmpty()Returnstrueif this array contains no elements.- Returns:
trueif this array contains no elements
-
isNull
boolean isNull(int index) Returnstrueif the value at the specified location in this array is Json null.- Parameters:
index- index of the JSON null value- Returns:
trueif the value at the specified location is Json null, otherwisefalse- Throws:
IndexOutOfBoundsException- if the index is out of range
-