Package io.vertigo.commons.script
Interface ScriptManager
- All Superinterfaces:
io.vertigo.core.node.component.Component,io.vertigo.core.node.component.CoreComponent,io.vertigo.core.node.component.Manager
- All Known Implementing Classes:
ScriptManagerImpl
public interface ScriptManager
extends io.vertigo.core.node.component.Manager
Manages scripts.
A script is composed of expressions.
A script (and experssions) can be parameterized.
- Author:
- pchretien
-
Method Summary
Modifier and TypeMethodDescription<J> JevaluateExpression(String expression, List<ExpressionParameter> parameters, Class<J> type) Evaluates an expression.evaluateScript(String script, SeparatorType separatorType, List<ExpressionParameter> parameters) Evaluates the script, transforms a script into a text.voidparse(String script, ScriptParserHandler scriptHandler, ScriptSeparator separator) Parses the script with a specific handler.
-
Method Details
-
parse
Parses the script with a specific handler. the grammar is defined by simple tags balises (separators).- Parameters:
script- the script to analysescriptHandler- the handerseparator- the allowed separators in the grammar.
-
evaluateScript
String evaluateScript(String script, SeparatorType separatorType, List<ExpressionParameter> parameters) Evaluates the script, transforms a script into a text.- Parameters:
script- the scriptseparatorType- the type of separatorparameters- the parameters- Returns:
- the evaluated script as a simplet text
-
evaluateExpression
Evaluates an expression. Examples of expressions written in java - name - birthDate - age>20 - salary>5000 invalid input: '&'invalid input: '&' age invalid input: '<'30 - name + surName- Parameters:
expression- the expressionparameters- the parameterstype- the returned type- Returns:
- the evaluated expression
-