
public class JreJsonArray extends JreJsonValue implements JsonArray
| Constructor and Description |
|---|
JreJsonArray(JsonFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
asBoolean()
Coerces underlying value to boolean according to the rules of Javascript coercion.
|
double |
asNumber()
Coerces the underlying value to a number according to the rules of Javascript coercion.
|
String |
asString()
Coerces the underlying value to a String according to the rules of JavaScript coercion.
|
JsonValue |
get(int index)
Return the ith element of the array.
|
JsonArray |
getArray(int index)
Return the ith element of the array (uncoerced) as a JsonArray.
|
boolean |
getBoolean(int index)
Return the ith element of the array (uncoerced) as a boolean.
|
double |
getNumber(int index)
Return the ith element of the array (uncoerced) as a number.
|
Object |
getObject() |
JsonObject |
getObject(int index)
Return the ith element of the array (uncoerced) as a JsonObject If the type is not an object,,
this can result in runtime errors.
|
String |
getString(int index)
Return the ith element of the array (uncoerced) as a String.
|
JsonType |
getType()
Returns an enumeration representing the fundamental JSON type.
|
boolean |
jsEquals(JsonValue value)
Equivalent of Javascript '==' operator comparison between two values.
|
int |
length()
Length of the array.
|
void |
remove(int index)
Remove an element of the array at a particular index.
|
void |
set(int index,
boolean bool)
Set the value at index to be a boolean value.
|
void |
set(int index,
double number)
Set the value at index to be a number value.
|
void |
set(int index,
JsonValue value)
Set the value at index to be a given value.
|
void |
set(int index,
String string)
Set the value at index to be a String value.
|
String |
toJson()
Returns a serialized JSON string representing this value.
|
void |
traverse(elemental.json.impl.JsonVisitor visitor,
elemental.json.impl.JsonContext ctx) |
toNativepublic JreJsonArray(JsonFactory factory)
public boolean asBoolean()
JsonValuepublic double asNumber()
JsonValuepublic String asString()
JsonValuepublic JsonValue get(int index)
JsonArraypublic JsonArray getArray(int index)
JsonArraypublic boolean getBoolean(int index)
JsonArraygetBoolean in interface JsonArraypublic double getNumber(int index)
JsonArraypublic JsonObject getObject(int index)
JsonArraypublic Object getObject()
getObject in class JreJsonValuepublic String getString(int index)
JsonArraypublic JsonType getType()
JsonValuepublic boolean jsEquals(JsonValue value)
JsonValuepublic int length()
JsonArraypublic void remove(int index)
JsonArraypublic void set(int index,
JsonValue value)
JsonArraypublic void set(int index,
String string)
JsonArraypublic void set(int index,
double number)
JsonArraypublic void set(int index,
boolean bool)
JsonArraypublic String toJson()
JsonValuepublic void traverse(elemental.json.impl.JsonVisitor visitor,
elemental.json.impl.JsonContext ctx)
traverse in class JreJsonValueCopyright © 2016. All rights reserved.