Package elemental.json.impl
Class JreJsonString
- java.lang.Object
-
- elemental.json.impl.JreJsonValue
-
- elemental.json.impl.JreJsonString
-
- All Implemented Interfaces:
JsonString
,JsonValue
,Serializable
public class JreJsonString extends JreJsonValue implements JsonString
Server-side implementation of JsonString.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JreJsonString(String string)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.Object
getObject()
String
getString()
JsonType
getType()
Returns an enumeration representing the fundamental JSON type.boolean
jsEquals(JsonValue value)
Equivalent of Javascript '==' operator comparison between two values.String
toJson()
Returns a serialized JSON string representing this value.void
traverse(elemental.json.impl.JsonVisitor visitor, elemental.json.impl.JsonContext ctx)
-
Methods inherited from class elemental.json.impl.JreJsonValue
parseJson, toNative
-
-
-
-
Constructor Detail
-
JreJsonString
public JreJsonString(String string)
-
-
Method Detail
-
asBoolean
public boolean asBoolean()
Description copied from interface:JsonValue
Coerces underlying value to boolean according to the rules of Javascript coercion.
-
asNumber
public double asNumber()
Description copied from interface:JsonValue
Coerces the underlying value to a number according to the rules of Javascript coercion.
-
asString
public String asString()
Description copied from interface:JsonValue
Coerces the underlying value to a String according to the rules of JavaScript coercion.
-
getObject
public Object getObject()
- Specified by:
getObject
in classJreJsonValue
-
getString
public String getString()
- Specified by:
getString
in interfaceJsonString
-
getType
public JsonType getType()
Description copied from interface:JsonValue
Returns an enumeration representing the fundamental JSON type.
-
jsEquals
public boolean jsEquals(JsonValue value)
Description copied from interface:JsonValue
Equivalent of Javascript '==' operator comparison between two values.
-
traverse
public void traverse(elemental.json.impl.JsonVisitor visitor, elemental.json.impl.JsonContext ctx)
- Specified by:
traverse
in classJreJsonValue
-
toJson
public String toJson() throws IllegalStateException
Description copied from interface:JsonValue
Returns a serialized JSON string representing this value.- Specified by:
toJson
in interfaceJsonValue
- Returns:
- Throws:
IllegalStateException
-
-