public class JcfRuntime extends BaseRuntime<Object>
| Constructor and Description |
|---|
JcfRuntime() |
JcfRuntime(FunctionRegistry functionRegistry) |
| Modifier and Type | Method and Description |
|---|---|
Object |
createArray(Collection<Object> elements)
Returns an array value with the specified elements.
|
Object |
createBoolean(boolean b)
Returns a boolean value containing the specified boolean.
|
Object |
createNull()
Returns a null value (not Java
null). |
Object |
createNumber(double n)
Returns a number value containing the specified floating point number.
|
Object |
createNumber(long n)
Returns a number value containing the specified integer.
|
Object |
createObject(Map<Object,Object> obj)
Returns an object value with the specified properties.
|
Object |
createString(String str)
Returns a string value containing the specified string.
|
Object |
getProperty(Object value,
Object name)
Returns the value of a property of an object.
|
Object |
getProperty(Object value,
String name)
Returns the value of a property of an object.
|
Collection<Object> |
getPropertyNames(Object value)
Returns all the property names of the given object, or an empty collection
when the given value does not represent an object.
|
boolean |
isTruthy(Object value)
Returns true when the argument is truthy.
|
Object |
parseString(String string)
Parse a JSON string to a value.
|
List<Object> |
toList(Object value)
Converts the argument to a
List. |
Number |
toNumber(Object n)
Converts the argument to a
Number, or null if the argument does not
represent a number. |
String |
toString(Object str)
Converts the argument to a
String. |
JmesPathType |
typeOf(Object value)
Returns the JSON type of the argument.
|
compare, compile, equals, escapeString, functionRegistry, hashCode, nodeFactory, unparse, unparseArray, unparseBoolean, unparseNull, unparseNumber, unparseObject, unparseStringclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic JcfRuntime()
public JcfRuntime(FunctionRegistry functionRegistry)
public Object parseString(String string)
Adapterpublic List<Object> toList(Object value)
AdapterList.
When the argument represents an array the list will contain the elements of
the array, when the argument represents an object the result is a list of
the object's values and for all other types the result is an empty list.public String toString(Object str)
AdapterString. When the argument represents a string
its string value is returned, otherwise a string with the value encoded
as JSON is returned.public Number toNumber(Object n)
AdapterNumber, or null if the argument does not
represent a number.public JmesPathType typeOf(Object value)
Adapternumber,
string, boolean, array,
object, null.JmesPathTypepublic boolean isTruthy(Object value)
Adapterfalse, null, empty lists, empty
objects, empty strings.public Object getProperty(Object value, String name)
Adapternull) is returned.public Object getProperty(Object value, Object name)
Adapterpublic Collection<Object> getPropertyNames(Object value)
Adapterpublic Object createNull()
Adapternull).public Object createArray(Collection<Object> elements)
Adapterpublic Object createString(String str)
Adapterpublic Object createBoolean(boolean b)
Adapterpublic Object createObject(Map<Object,Object> obj)
Adapterpublic Object createNumber(double n)
AdapterCopyright © 2016. All rights reserved.