
@GwtScriptOnly public final class JsoSplittable extends JavaScriptObject implements Splittable, HasSplittable
A string value represented by a JsoSplittable can't use the string object
directly, since String.prototype is overridden, so instead a
temporary wrapper object is used to encapsulate the string data.
NULL| Modifier | Constructor and Description |
|---|---|
protected |
JsoSplittable() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
asBoolean()
Returns a boolean representation of the data.
|
double |
asNumber()
Returns a numeric representation of the data.
|
void |
assign(Splittable parent,
int index)
Assign the splittable to the specified index of the
parent object. |
void |
assign(Splittable parent,
String index)
Assign the splittable to the named property of the
parent object. |
String |
asString()
Returns a string representation of the data.
|
static JsoSplittable |
create() |
static Splittable |
create(boolean value) |
static Splittable |
create(double value) |
static Splittable |
create(String value) |
static JsoSplittable |
createIndexed() |
Splittable |
deepCopy()
Clones the Splittable, ignoring cycles and tags.
|
JsoSplittable |
get(int index)
Returns the nth element of a list.
|
JsoSplittable |
get(String key)
Returns the named property.
|
String |
getPayload()
Returns a wire-format representation of the data.
|
List<String> |
getPropertyKeys()
Returns all keys available in the Splittable.
|
Object |
getReified(String key)
Returns a value previously set with
Splittable.setReified(String, Object). |
Splittable |
getSplittable() |
boolean |
isBoolean()
Returns
true if the value of the Splittable is a boolean. |
boolean |
isFunction() |
boolean |
isIndexed()
Returns
true if Splittable.size() and Splittable.get(int) can be
expected to return meaningful values. |
boolean |
isKeyed()
Returns
true if Splittable.getPropertyKeys() and Splittable.get(String)
can be expected to return meaningful values. |
boolean |
isNull(int index)
Indicates if the nth element of a list is null or undefined.
|
boolean |
isNull(String key)
Indicates if the named property is null or undefined.
|
boolean |
isNumber()
Returns
true if the value of the Splittable is numeric. |
boolean |
isReified(String key)
Returns
true if Splittable.setReified(String, Object) has been called
with the given key. |
boolean |
isString()
Returns whether or not the current object is a string-carrier.
|
boolean |
isUndefined(String key)
Returns
true if the value of the key is undefined. |
static Splittable |
nullValue() |
void |
removeReified(String key)
Removes a tag value from the Splittable.
|
void |
setReified(String key,
Object object)
Associates a tag value with the Splittable.
|
void |
setSize(int size)
Resets the length of an indexed Splittable.
|
int |
size()
Returns the size of an indexed Splittable.
|
cast, createArray, createArray, createFunction, createObject, equals, hashCode, toSource, toStringpublic static JsoSplittable create()
public static Splittable create(boolean value)
public static Splittable create(double value)
public static Splittable create(String value)
public static JsoSplittable createIndexed()
public static Splittable nullValue()
public boolean asBoolean()
SplittableasBoolean in interface Splittablepublic double asNumber()
SplittableasNumber in interface Splittablepublic void assign(Splittable parent, int index)
Splittableparent object.assign in interface Splittablepublic void assign(Splittable parent, String index)
Splittableparent object.assign in interface Splittablepublic String asString()
SplittableasString in interface Splittablepublic Splittable deepCopy()
SplittabledeepCopy in interface Splittablepublic JsoSplittable get(int index)
Splittableget in interface Splittablepublic JsoSplittable get(String key)
Splittableget in interface Splittablepublic String getPayload()
SplittablegetPayload in interface Splittablepublic List<String> getPropertyKeys()
SplittablegetPropertyKeys in interface Splittablepublic Object getReified(String key)
SplittableSplittable.setReified(String, Object).getReified in interface Splittablepublic Splittable getSplittable()
getSplittable in interface HasSplittablepublic boolean isBoolean()
Splittabletrue if the value of the Splittable is a boolean.isBoolean in interface Splittablepublic boolean isFunction()
public boolean isIndexed()
Splittable true if Splittable.size() and Splittable.get(int) can be
expected to return meaningful values.isIndexed in interface Splittablepublic boolean isKeyed()
Splittable true if Splittable.getPropertyKeys() and Splittable.get(String)
can be expected to return meaningful values.isKeyed in interface Splittablepublic boolean isNull(int index)
SplittableisNull in interface Splittablepublic boolean isNull(String key)
SplittableisNull in interface Splittablepublic boolean isNumber()
Splittabletrue if the value of the Splittable is numeric.isNumber in interface Splittablepublic boolean isReified(String key)
Splittabletrue if Splittable.setReified(String, Object) has been called
with the given key.isReified in interface Splittablepublic boolean isString()
isString in interface Splittablepublic boolean isUndefined(String key)
Splittabletrue if the value of the key is undefined.isUndefined in interface Splittablepublic void removeReified(String key)
SplittableremoveReified in interface Splittablekey - the key for the value to be removedpublic void setReified(String key, Object object)
SplittablesetReified in interface Splittablepublic void setSize(int size)
SplittablesetSize in interface Splittablepublic int size()
Splittablesize in interface SplittableCopyright © 2016. All rights reserved.