Class JSR223Engine
java.lang.Object
net.citizensnpcs.api.ai.tree.expr.JSR223Engine
- All Implemented Interfaces:
ExpressionEngine
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.citizensnpcs.api.ai.tree.expr.ExpressionEngine
ExpressionEngine.ExpressionCompileException -
Constructor Summary
ConstructorsConstructorDescriptionJSR223Engine(String language) Creates a script engine with the given language name. -
Method Summary
Modifier and TypeMethodDescriptionCompiles an expression string into a reusable compiled form.getName()static JSR223Engine
-
Constructor Details
-
JSR223Engine
Creates a script engine with the given language name.- Parameters:
language- the script engine name (e.g., "js", "javascript", "groovy")- Throws:
IllegalArgumentException- if the engine is not available
-
-
Method Details
-
compile
public CompiledExpression compile(String expression) throws ExpressionEngine.ExpressionCompileException Description copied from interface:ExpressionEngineCompiles an expression string into a reusable compiled form.- Specified by:
compilein interfaceExpressionEngine- Parameters:
expression- the expression text- Returns:
- a compiled expression that can be evaluated multiple times
- Throws:
ExpressionEngine.ExpressionCompileException
-
getName
- Specified by:
getNamein interfaceExpressionEngine
-
javascript
-