Class JsonArray

  • All Implemented Interfaces:
    JsonValue

    public class JsonArray
    extends Object
    implements JsonValue
    Server-side implementation of JsonArray.
    • Constructor Detail

    • Method Detail

      • isEmpty

        public boolean isEmpty()
        Description copied from interface: JsonValue
        Check if the json has no value stored.
        Specified by:
        isEmpty in interface JsonValue
      • asBoolean

        public boolean asBoolean()
        Description copied from interface: JsonValue
        Convert the underlying value to boolean
        Specified by:
        asBoolean in interface JsonValue
      • asNumber

        public double asNumber()
        Description copied from interface: JsonValue
        Convert the underlying value to a number
        Specified by:
        asNumber in interface JsonValue
      • asString

        public String asString()
        Description copied from interface: JsonValue
        Convert the underlying value to a String
        Specified by:
        asString in interface JsonValue
      • getArray

        public JsonArray getArray​(int index)
      • getBoolean

        public boolean getBoolean​(int index)
      • getNumber

        public double getNumber​(int index)
      • getObject

        public JsonObject getObject​(int index)
      • getString

        public String getString​(int index)
      • getType

        public JsonType getType()
        Description copied from interface: JsonValue
        Returns an enumeration representing the fundamental JSON type.
        Specified by:
        getType in interface JsonValue
      • length

        public int length()
      • remove

        public void remove​(int index)
      • set

        public void set​(int index,
                        JsonValue value)
      • set

        public void set​(int index,
                        String string)
      • set

        public void set​(int index,
                        double number)
      • set

        public void set​(int index,
                        boolean bool)
      • toJson

        public String toJson()
        Description copied from interface: JsonValue
        Returns a serialized JSON string representing this value.
        Specified by:
        toJson in interface JsonValue
      • traverse

        public void traverse​(org.dashbuilder.json.JsonVisitor visitor,
                             org.dashbuilder.json.JsonContext ctx)
        Description copied from interface: JsonValue
        Visitor interface
        Specified by:
        traverse in interface JsonValue