Package org.cyclos.impl.system
Interface CustomScriptAccessor
-
public interface CustomScriptAccessorAccessor interface for invoking custom scripts
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CustomScriptAccessorbind(String name, Object value)Binds a variable to the script context.CustomScriptAccessorbindAll(Map<String,?> bindings)Binds all the given variables to the script contextObjectrun()Runs the default script function (only if the script function type isDefaultScriptFunction).<T> Trun(Class<T> expectedType)Runs the default script function (only if the script function type isDefaultScriptFunction), converting the result to the given type.<T> Trun(Class<T> expectedType, ScriptFunction function)Runs the given script function, converting the result to the given type.Objectrun(ScriptFunction function)Runs the given script function.<T> List<T>runForList(Class<T> elementType)Runs the default script function (only if the script function type isDefaultScriptFunction), handling the result as a list of the given element type.<T> List<T>runForList(Class<T> elementType, ScriptFunction function)Runs the given script function, handling the result as a list of the given element type..
-
-
-
Method Detail
-
bind
CustomScriptAccessor bind(String name, Object value)
Binds a variable to the script context. Ignores if the name is null (useful to avoid conditional tests)
-
bindAll
CustomScriptAccessor bindAll(Map<String,?> bindings)
Binds all the given variables to the script context
-
run
Object run()
Runs the default script function (only if the script function type isDefaultScriptFunction).
-
run
<T> T run(Class<T> expectedType)
Runs the default script function (only if the script function type isDefaultScriptFunction), converting the result to the given type.
-
run
<T> T run(Class<T> expectedType, ScriptFunction function)
Runs the given script function, converting the result to the given type. If the function is optional and is not defined, returns null
-
run
Object run(ScriptFunction function)
Runs the given script function. If the function is optional and is not defined, returns null
-
runForList
<T> List<T> runForList(Class<T> elementType)
Runs the default script function (only if the script function type isDefaultScriptFunction), handling the result as a list of the given element type.
-
runForList
<T> List<T> runForList(Class<T> elementType, ScriptFunction function)
Runs the given script function, handling the result as a list of the given element type.. If the function is optional and is not defined, returns null
-
-