Enum Class JSONFunctions
- All Implemented Interfaces:
ScriptFunctionType
,Serializable
,Comparable<JSONFunctions>
,java.lang.constant.Constable
Script common functions for converting JSON to Maps (and vice-versa).
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Nested classes/interfaces inherited from interface com.blackrook.rookscript.lang.ScriptFunctionType
ScriptFunctionType.Usage
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic final ScriptFunctionResolver
abstract boolean
execute
(ScriptInstance scriptInstance, ScriptValue returnValue) Executes this function.int
getUsage()
protected abstract ScriptFunctionType.Usage
usage()
static JSONFunctions
Returns the enum constant of this class with the specified name.static JSONFunctions[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from interface com.blackrook.rookscript.lang.ScriptFunctionType
name
-
Enum Constant Details
-
READJSON
-
WRITEJSON
-
JSONSTR
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
createResolver
- Returns:
- a function resolver that handles all of the functions in this enum.
-
getParameterCount
public int getParameterCount()- Specified by:
getParameterCount
in interfaceScriptFunctionType
- Returns:
- the total amount of parameters this takes.
-
getUsage
- Specified by:
getUsage
in interfaceScriptFunctionType
- Returns:
- this function's usage instructions.
-
execute
Description copied from interface:ScriptFunctionType
Executes this function. The value inreturnValue
is automatically pushed onto the stack after the call. If aThrowable
is thrown from this call, it is wrapped in aScriptExecutionException
.ScriptExecutionException
s are thrown as-is.- Specified by:
execute
in interfaceScriptFunctionType
- Parameters:
scriptInstance
- the originating script instance.returnValue
- the value pushed to the stack on return.- Returns:
- if false, this halts script execution, else if true, continue.
-
usage
-