org.apache.tools.ant.types.optional
Class AbstractScriptComponent
- Cloneable
public abstract class AbstractScriptComponent
This is a
ProjectComponent
that has script support built in
Use it as a foundation for scriptable things.
addText
public void addText(String text)
The script text.
text
- a component of the script text to be added.
createClasspath
public Path createClasspath()
Classpath to be used when searching for classes and resources.
- an empty Path instance to be configured by Ant.
executeScript
protected void executeScript(String execName)
Run a script
execName
- name of the script
initScriptRunner
protected void initScriptRunner()
Initialize the script runner. Calls this before running the system
setClasspath
public void setClasspath(Path classpath)
Set the classpath to be used when searching for classes and resources.
classpath
- an Ant Path object containing the search path.
setClasspathRef
public void setClasspathRef(Reference r)
Set the classpath by reference.
r
- a Reference to a Path instance to be used as the classpath
value.
setLanguage
public void setLanguage(String language)
Defines the language (required).
language
- the scripting language name for the script.
setManager
public void setManager(String manager)
Defines the manager.
manager
- the scripting manager.
setSrc
public void setSrc(File file)
Load the script from an external file ; optional.
file
- the file containing the script source.