@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, toString
public 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()
Splittable
asBoolean
in interface Splittable
public double asNumber()
Splittable
asNumber
in interface Splittable
public void assign(Splittable parent, int index)
Splittable
parent
object.assign
in interface Splittable
public void assign(Splittable parent, String index)
Splittable
parent
object.assign
in interface Splittable
public String asString()
Splittable
asString
in interface Splittable
public Splittable deepCopy()
Splittable
deepCopy
in interface Splittable
public JsoSplittable get(int index)
Splittable
get
in interface Splittable
public JsoSplittable get(String key)
Splittable
get
in interface Splittable
public String getPayload()
Splittable
getPayload
in interface Splittable
public List<String> getPropertyKeys()
Splittable
getPropertyKeys
in interface Splittable
public Object getReified(String key)
Splittable
Splittable.setReified(String, Object)
.getReified
in interface Splittable
public Splittable getSplittable()
getSplittable
in interface HasSplittable
public boolean isBoolean()
Splittable
true
if the value of the Splittable is a boolean.isBoolean
in interface Splittable
public boolean isFunction()
public boolean isIndexed()
Splittable
true if Splittable.size()
and Splittable.get(int)
can be
expected to return meaningful values.isIndexed
in interface Splittable
public boolean isKeyed()
Splittable
true if Splittable.getPropertyKeys()
and Splittable.get(String)
can be expected to return meaningful values.isKeyed
in interface Splittable
public boolean isNull(int index)
Splittable
isNull
in interface Splittable
public boolean isNull(String key)
Splittable
isNull
in interface Splittable
public boolean isNumber()
Splittable
true
if the value of the Splittable is numeric.isNumber
in interface Splittable
public boolean isReified(String key)
Splittable
true
if Splittable.setReified(String, Object)
has been called
with the given key.isReified
in interface Splittable
public boolean isString()
isString
in interface Splittable
public boolean isUndefined(String key)
Splittable
true
if the value of the key is undefined.isUndefined
in interface Splittable
public void removeReified(String key)
Splittable
removeReified
in interface Splittable
key
- the key for the value to be removedpublic void setReified(String key, Object object)
Splittable
setReified
in interface Splittable
public void setSize(int size)
Splittable
setSize
in interface Splittable
public int size()
Splittable
size
in interface Splittable
Copyright © 2016. All rights reserved.