public interface ScriptValue
| Modifier and Type | Method and Description |
|---|---|
ScriptValue |
call(Object... args)
Call this function if it's a function.
|
List<ScriptValue> |
getArray()
Returns the value as array.
|
Set<String> |
getKeys()
Returns the object keys if this value is object.
|
Map<String,ScriptValue> |
getMap()
Returns the value as map.
|
ScriptValue |
getMember(String key)
Returns the named member or null.
|
Object |
getRaw()
Returns the raw (wrapped) object.
|
Object |
getValue()
Returns the value if it's type value.
|
<T> T |
getValue(Class<T> type)
Returns the value if the type is value and converts it.
|
boolean |
hasMember(String key)
Returns true if it has a member by specified name.
|
boolean |
isArray()
Returns true if this value is an array.
|
boolean |
isFunction()
Returns true if this value is a function.
|
boolean |
isObject()
Returns true if this value is a object.
|
boolean |
isValue()
Returns true if this value is a simple value.
|
Object |
toJavaObject()
Returns the value as Java object.
|
com.google.gson.JsonElement |
toJson()
Returns the value as JSON.
|
boolean isArray()
boolean isObject()
boolean isValue()
boolean isFunction()
Object getValue()
<T> T getValue(Class<T> type)
T - Type to convert to.type - Type to convert to.Set<String> getKeys()
boolean hasMember(String key)
key - Name of member.ScriptValue getMember(String key)
key - Name of member.List<ScriptValue> getArray()
Map<String,ScriptValue> getMap()
ScriptValue call(Object... args)
args - Optional arguments.com.google.gson.JsonElement toJson()
Object toJavaObject()
Object getRaw()