Package org.fugerit.java.script.helper
Class EvalScriptWithJsonDataModel
java.lang.Object
org.fugerit.java.script.helper.EvalScriptWithJsonDataModel
- All Implemented Interfaces:
EvalScript
EvalScript decorator.
The Map dataModel will be transformed into a json styled LinkedHashMap.
-
Constructor Summary
ConstructorsConstructorDescriptionEvalScriptWithJsonDataModel
(EvalScript evalScript) Add decoration to a give EvalScript -
Method Summary
Modifier and TypeMethodDescriptionIt will handle a script and bind a data model.static EvalScript
newEvalScriptWithJsonDataModel
(String scriptExtension) It will decorate a EvalScriptWithDataModel instance with default data model binding name.static EvalScript
newEvalScriptWithJsonDataModel
(String scriptExtension, String dataModelBindingName) It will decorate a EvalScriptWithDataModel instance.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.fugerit.java.script.helper.EvalScript
handle, handle, handleEx
-
Constructor Details
-
EvalScriptWithJsonDataModel
Add decoration to a give EvalScript- Parameters:
evalScript
- the EvalScript instance to decorate
-
-
Method Details
-
handleEx
Description copied from interface:EvalScript
It will handle a script and bind a data model. Any class implementing EvalScript will need to provide at least this method.- Specified by:
handleEx
in interfaceEvalScript
- Parameters:
reader
- the reader over scriptdataModel
- the data model to bind- Returns:
- the result of script processing
- Throws:
ScriptException
- in case of script handling issues
-
newEvalScriptWithJsonDataModel
public static EvalScript newEvalScriptWithJsonDataModel(String scriptExtension, String dataModelBindingName) It will decorate a EvalScriptWithDataModel instance.- Parameters:
scriptExtension
- the extension to be used for the ScriptEnginedataModelBindingName
- the data model binding name- Returns:
- the new EvalScript
-
newEvalScriptWithJsonDataModel
It will decorate a EvalScriptWithDataModel instance with default data model binding name.- Parameters:
scriptExtension
- the extension to be used for the ScriptEngine- Returns:
- the new EvalScript
-