Implementation of
DataTransformer
that is based on standard
Java scripting capabilities (javax.script).
By default it uses Rhino scripting engine for JavaScript evaluation. But supports
all scripting engine that are compliant with JSR 223. It's just a matter of
placing them on classpath so Java itself can discover it and then new instance
of this class will be registered for that engine.
Allows to pass custom properties to the engine via property file that should be
placed on root of the classpath named 'FQCN of the script engine factory'.properties
When reading the properties file transformer recognizes three types of data:
- boolean - when value is either true or false string
- integer - when value is a number (matches \d+ regex)
- string - default type
return value of the expression is either:
- value returned from scriptEngine.eval if not null
- result of the output produced by the script engine - will be used only when eval returns null