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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <J> J
evaluateExpression(String expression, List<ExpressionParameter> parameters, Class<J> type)
Evaluates an expression.String
evaluateScript(String script, SeparatorType separatorType, List<ExpressionParameter> parameters)
Evaluates the script, transforms a script into a text.void
parse(String script, ScriptParserHandler scriptHandler, ScriptSeparator separator)
Parses the script with a specific handler.
-
-
-
Method Detail
-
parse
void parse(String script, ScriptParserHandler scriptHandler, ScriptSeparator separator)
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
<J> J evaluateExpression(String expression, List<ExpressionParameter> parameters, Class<J> type)
Evaluates an expression. Examples of expressions written in java - name - birthDate - age>20 - salary>5000 && age <30 - name + surName- Parameters:
expression
- the expressionparameters
- the parameterstype
- the returned type- Returns:
- the evaluated expression
-
-