FileDocCategorySizeDatePackage
AbstractScriptComponent.javaAPI DocApache Ant 1.703969Wed Dec 13 06:16:22 GMT 2006org.apache.tools.ant.types.optional

AbstractScriptComponent

public abstract class AbstractScriptComponent extends org.apache.tools.ant.ProjectComponent
This is a {@link ProjectComponent} that has script support built in Use it as a foundation for scriptable things.

Fields Summary
private org.apache.tools.ant.util.ScriptRunnerHelper
helper
script runner helper
private org.apache.tools.ant.util.ScriptRunnerBase
runner
script runner.
Constructors Summary
Methods Summary
public voidaddText(java.lang.String text)
The script text.

param
text a component of the script text to be added.

        helper.addText(text);
    
public org.apache.tools.ant.types.PathcreateClasspath()
Classpath to be used when searching for classes and resources.

return
an empty Path instance to be configured by Ant.

        return helper.createClasspath();
    
protected voidexecuteScript(java.lang.String execName)
Run a script

param
execName name of the script

        getRunner().executeScript(execName);
    
public org.apache.tools.ant.util.ScriptRunnerBasegetRunner()
Get our script runner

return
the runner

        initScriptRunner();
        return runner;
    
protected voidinitScriptRunner()
Initialize the script runner. Calls this before running the system

        if (runner != null) {
            return;
        }
        helper.setProjectComponent(this);
        runner = helper.getScriptRunner();
    
public voidsetClasspath(org.apache.tools.ant.types.Path classpath)
Set the classpath to be used when searching for classes and resources.

param
classpath an Ant Path object containing the search path.

        helper.setClasspath(classpath);
    
public voidsetClasspathRef(org.apache.tools.ant.types.Reference r)
Set the classpath by reference.

param
r a Reference to a Path instance to be used as the classpath value.

        helper.setClasspathRef(r);
    
public voidsetLanguage(java.lang.String language)
Defines the language (required).

param
language the scripting language name for the script.

        helper.setLanguage(language);
    
public voidsetManager(java.lang.String manager)
Defines the manager.

param
manager the scripting manager.

        helper.setManager(manager);
    
public voidsetProject(org.apache.tools.ant.Project project)
Set the project.

param
project the owner of this component.


                   
        
        super.setProject(project);
        helper.setProjectComponent(this);
    
public voidsetSrc(java.io.File file)
Load the script from an external file ; optional.

param
file the file containing the script source.

        helper.setSrc(file);