ScriptRunner (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.util, class: ScriptRunner

# Class ScriptRunner

java.lang.Object
org.apache.tools.ant.util.ScriptRunnerBase
org.apache.tools.ant.util.optional.ScriptRunner
org.apache.tools.ant.util.ScriptRunner

public class ScriptRunner extends ScriptRunner
Deprecated.
Implementation moved to another location. Use org.apache.tools.ant.util.optional.ScriptRunner instead.
This class is here for backwards compatibility.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ScriptRunner()`
  Deprecated.

- ## Method Summary

  ### Methods inherited from class ScriptRunner

  `evaluateScript, executeScript, getManagerName, supportsLanguage`
  Modifier and Type
  Method
  Description
  `Object`
  `evaluateScript(String execName)`
  Evaluate the script.
  `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 ScriptRunnerBase

  `addBean, addBeans, addText, bindToComponent, bindToComponentMinimum, checkLanguage, clearScript, getBeans, getCompiled, getKeepEngine, getLanguage, getProject, getScript, getScriptClassLoader, loadResource, loadResources, replaceContextLoader, restoreContextLoader, setCompiled, setEncoding, setKeepEngine, setLanguage, setProject, setScriptClassLoader, setSrc`
  Modifier and Type
  Method
  Description
  `void`
  `addBean(String key, Object bean)`
  Add a single object into the script context.
  `void`
  `addBeans(Map<String,?> dictionary)`
  Add a list of named objects to the list to be exported to the script
  `void`
  `addText(String text)`
  Set the script text.
  `void`
  `bindToComponent(ProjectComponent component)`
  Bind the runner to a project component.
  `void`
  `bindToComponentMinimum(ProjectComponent component)`
  Bind the runner to a project component.
  `protected void`
  `checkLanguage()`
  Check if the language attribute is set.
  `void`
  `clearScript()`
  Clear the current script text content.
  `protected Map<String,Object>`
  `getBeans()`
  Get the beans used for the script.
  `final boolean`
  `getCompiled()`
  Get the compiled attribute.
  `boolean`
  `getKeepEngine()`
  Get the keep engine attribute.
  `String`
  `getLanguage()`
  Get the script language
  `Project`
  `getProject()`
  Get the project for this runner.
  `String`
  `getScript()`
  Get the current script text content.
  `protected ClassLoader`
  `getScriptClassLoader()`
  Get the classloader used to load the script engine.
  `void`
  `loadResource(Resource sourceResource)`
  Add a resource to the source list.
  `void`
  `loadResources(ResourceCollection collection)`
  Add all resources in a resource collection to the source list.
  `protected ClassLoader`
  `replaceContextLoader()`
  Replace the current context classloader with the script context classloader.
  `protected void`
  `restoreContextLoader(ClassLoader origLoader)`
  Restore the context loader with the original context classloader.
  `final void`
  `setCompiled(boolean compiled)`
  Whether to use script compilation if available.
  `void`
  `setEncoding(String encoding)`
  Set encoding of the script from an external file; optional.
  `void`
  `setKeepEngine(boolean keepEngine)`
  Whether to keep the script engine between calls.
  `void`
  `setLanguage(String language)`
  Defines the language (required).
  `void`
  `setProject(Project project)`
  Set the project for this runner.
  `void`
  `setScriptClassLoader(ClassLoader classLoader)`
  Set the script classloader.
  `void`
  `setSrc(File file)`
  Load the script from an external file; optional.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ScriptRunner

    public ScriptRunner()
    Deprecated.