org.apache.tools.ant.util.optional

Class ScriptRunner

Known Direct Subclasses:
ScriptRunner

public class ScriptRunner
extends ScriptRunnerBase

This class is used to run BSF scripts

Method Summary

Object
evaluateScript(String execName)
Do the work.
void
executeScript(String execName)
Do the work.
String
getManagerName()
Get the name of the manager prefix.
boolean
supportsLanguage()
Check if bsf supports the language.

Methods inherited from class org.apache.tools.ant.util.ScriptRunnerBase

addBean, addBeans, addText, bindToComponent, bindToComponentMinimum, checkLanguage, clearScript, evaluateScript, executeScript, getBeans, getKeepEngine, getLanguage, getManagerName, getProject, getScript, getScriptClassLoader, replaceContextLoader, restoreContextLoader, setKeepEngine, setLanguage, setProject, setScriptClassLoader, setSrc, supportsLanguage

Method Details

evaluateScript

public Object evaluateScript(String execName)
            throws BuildException
Do the work.
Overrides:
evaluateScript in interface ScriptRunnerBase
Parameters:
execName - the name that will be passed to BSF for this script execution.
Returns:
the result of the evalulation
Throws:
BuildException - if someting goes wrong exectuing the script.

executeScript

public void executeScript(String execName)
            throws BuildException
Do the work.
Overrides:
executeScript in interface ScriptRunnerBase
Parameters:
execName - the name that will be passed to BSF for this script execution.
Throws:
BuildException - if someting goes wrong exectuing the script.

getManagerName

public String getManagerName()
Get the name of the manager prefix.
Overrides:
getManagerName in interface ScriptRunnerBase
Returns:
"bsf"

supportsLanguage

public boolean supportsLanguage()
Check if bsf supports the language.
Overrides:
supportsLanguage in interface ScriptRunnerBase
Returns:
true if bsf can create an engine for this language.