Interface JsonArray

All Superinterfaces:
JsonValue

public interface JsonArray extends JsonValue
Represents a Json array. Abstracted from javax.json (J2EE) and Jersey.
Author:
Holger Eichelberger, SSE
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    getBoolean(int index)
    Returns the boolean value at the specified position.
    int
    getInt(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.
    boolean
    Returns true if this array contains no elements.
    boolean
    isNull(int index)
    Returns true if the value at the specified location in this array is Json null.
    int
    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

      JsonObject getJsonObject(int index)
      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 range
      ClassCastException - if the value at the specified position is not assignable to the JsonObject type
    • getJsonArray

      JsonArray getJsonArray(int index)
      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 range
      ClassCastException - if the value at the specified position is not assignable to the JsonArray type
    • getJsonNumber

      JsonNumber getJsonNumber(int index)
      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 range
      ClassCastException - if the value at the specified position is not assignable to the JsonNumber type
    • getJsonString

      JsonString getJsonString(int index)
      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 range
      ClassCastException - if the value at the specified position is not assignable to the JsonString type
    • getString

      String getString(int index)
      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 range
      ClassCastException - 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 range
      ClassCastException - 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 range
      ClassCastException - if the value at the specified position is not assignable
    • getValue

      JsonValue getValue(int index)
      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()
      Returns true if this array contains no elements.
      Returns:
      true if this array contains no elements
    • isNull

      boolean isNull(int index)
      Returns true if the value at the specified location in this array is Json null.
      Parameters:
      index - index of the JSON null value
      Returns:
      true if the value at the specified location is Json null, otherwise false
      Throws:
      IndexOutOfBoundsException - if the index is out of range