org.apache.tools.ant.util.optional
Class ScriptRunner

java.lang.Object
  extended by org.apache.tools.ant.util.ScriptRunnerBase
      extended by org.apache.tools.ant.util.optional.ScriptRunner
Direct Known Subclasses:
ScriptRunner

public class ScriptRunner
extends ScriptRunnerBase

This class is used to run BSF scripts


Constructor Summary
ScriptRunner()
           
 
Method Summary
 java.lang.Object evaluateScript(java.lang.String execName)
          Do the work.
 void executeScript(java.lang.String execName)
          Do the work.
 java.lang.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, getBeans, getKeepEngine, getLanguage, getProject, getScript, getScriptClassLoader, replaceContextLoader, restoreContextLoader, setKeepEngine, setLanguage, setProject, setScriptClassLoader, setSrc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptRunner

public ScriptRunner()
Method Detail

getManagerName

public java.lang.String getManagerName()
Get the name of the manager prefix.

Specified by:
getManagerName in class ScriptRunnerBase
Returns:
"bsf"

supportsLanguage

public boolean supportsLanguage()
Check if bsf supports the language.

Specified by:
supportsLanguage in class ScriptRunnerBase
Returns:
true if bsf can create an engine for this language.

executeScript

public void executeScript(java.lang.String execName)
                   throws BuildException
Do the work.

Specified by:
executeScript in class ScriptRunnerBase
Parameters:
execName - the name that will be passed to BSF for this script execution.
Throws:
BuildException - if someting goes wrong exectuing the script.

evaluateScript

public java.lang.Object evaluateScript(java.lang.String execName)
                                throws BuildException
Do the work.

Specified by:
evaluateScript in class 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.