Package org.dashbuilder.json
Class JsonArray
- java.lang.Object
-
- org.dashbuilder.json.JsonArray
-
-
Constructor Summary
Constructors Constructor Description JsonArray(JsonFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanasBoolean()Convert the underlying value to booleandoubleasNumber()Convert the underlying value to a numberStringasString()Convert the underlying value to a StringJsonValueget(int index)JsonArraygetArray(int index)booleangetBoolean(int index)doublegetNumber(int index)JsonObjectgetObject(int index)StringgetString(int index)JsonTypegetType()Returns an enumeration representing the fundamental JSON type.booleanisEmpty()Check if the json has no value stored.intlength()voidremove(int index)voidset(int index, boolean bool)voidset(int index, double number)voidset(int index, String string)voidset(int index, JsonValue value)StringtoJson()Returns a serialized JSON string representing this value.voidtraverse(org.dashbuilder.json.JsonVisitor visitor, org.dashbuilder.json.JsonContext ctx)Visitor interface
-
-
-
Constructor Detail
-
JsonArray
public JsonArray(JsonFactory factory)
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
Description copied from interface:JsonValueCheck if the json has no value stored.
-
asBoolean
public boolean asBoolean()
Description copied from interface:JsonValueConvert the underlying value to boolean
-
asNumber
public double asNumber()
Description copied from interface:JsonValueConvert the underlying value to a number
-
asString
public String asString()
Description copied from interface:JsonValueConvert the underlying value to a String
-
get
public JsonValue get(int index)
-
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:JsonValueReturns an enumeration representing the fundamental JSON type.
-
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:JsonValueReturns a serialized JSON string representing this value.
-
-