Class ResourceScriptEvaluator
java.lang.Object
org.apache.maven.plugins.scripting.ResourceScriptEvaluator
Evaluates a script held in a resource. Use the engine name to override the engine if the resource name does not
refer/decode to a valid engine name or not define any at all.
- Author:
- Robert Scholte
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final Objectprotected Objecteval(ScriptEngine engine, ScriptContext context) AbstractScriptEvaluator the scriptprotected ScriptEnginegetEngine(ScriptEngineManager manager) Gets the script engine by engineName, otherwise by extension of the sciptFile
-
Constructor Details
-
ResourceScriptEvaluator
-
-
Method Details
-
eval
AbstractScriptEvaluator the script- Parameters:
engine- the script engine.context- the script context.- Returns:
- the result of the scriptFile.
- Throws:
ScriptException- if an error occurs in script.- See Also:
-
getEngine
protected ScriptEngine getEngine(ScriptEngineManager manager) throws UnsupportedScriptEngineException Gets the script engine by engineName, otherwise by extension of the sciptFile- Parameters:
manager- the script engine manager- Returns:
- non-null engine to execute the script
- Throws:
UnsupportedScriptEngineException- if specified engine is not available- See Also:
-
eval
protected final Object eval(Bindings bindings, org.apache.maven.plugin.logging.Log log) throws ScriptException, UnsupportedScriptEngineException - Parameters:
bindings- not null bindings to provide to the script to executelog- engine logger if context aware- Returns:
- the possibly null result the script produced
- Throws:
UnsupportedScriptEngineException- when the engine is not configured correctlyScriptException- if an error occurs in script.
-