public class FileScriptEvaluator extends Object
Constructor and Description |
---|
FileScriptEvaluator(String engineName,
File scriptFile) |
Modifier and Type | Method and Description |
---|---|
Object |
eval(Bindings bindings) |
protected Object |
eval(ScriptEngine engine,
ScriptContext context)
AbstractScriptEvaluator the script
|
protected ScriptEngine |
getEngine(ScriptEngineManager manager)
Gets the script engine by engineName, otherwise by extension of the sciptFile
|
protected Object eval(ScriptEngine engine, ScriptContext context) throws ScriptException
engine
- the script engine.context
- the script context.ScriptException
- if an error occurs in script.AbstractScriptEvaluator.eval(javax.script.ScriptEngine, javax.script.ScriptContext)
protected ScriptEngine getEngine(ScriptEngineManager manager) throws UnsupportedScriptEngineException
manager
- the script engine managerUnsupportedScriptEngineException
- if specified engine is not availableAbstractScriptEvaluator.getEngine(javax.script.ScriptEngineManager)
public final Object eval(Bindings bindings) throws ScriptException, UnsupportedScriptEngineException
bindings
- not null bindings to provide to the script to executeUnsupportedScriptEngineException
- when the engine is not configured correctlyScriptException
- if an error occurs in script.Copyright © 2016–2021 The Apache Software Foundation. All rights reserved.