Methods Summary |
---|
public void | addText(java.lang.String text)The script text.
this.text = text;
|
public org.apache.tools.ant.types.Path | createClasspath()Classpath to be used when searching for classes and resources.
return getClassPathDelegate().createClasspath();
|
private java.lang.ClassLoader | generateClassLoader()
if (scriptLoader != null) {
return scriptLoader;
}
if (cpDelegate == null) {
scriptLoader = getClass().getClassLoader();
return scriptLoader;
}
scriptLoader = cpDelegate.getClassLoader();
return scriptLoader;
|
private ClasspathUtils.Delegate | getClassPathDelegate()
if (cpDelegate == null) {
cpDelegate = ClasspathUtils.getDelegate(projectComponent);
}
return cpDelegate;
|
public java.lang.String | getLanguage()Get the language.
return language;
|
private ScriptRunnerBase | getRunner()Get a script runner.
return new ScriptRunnerCreator(
projectComponent.getProject()).createRunner(
manager, language, generateClassLoader());
|
public ScriptRunnerBase | getScriptRunner()Create and set text on a script.
ScriptRunnerBase runner = getRunner();
if (srcFile != null) {
runner.setSrc(srcFile);
}
if (text != null) {
runner.addText(text);
}
if (setBeans) {
runner.bindToComponent(projectComponent);
} else {
runner.bindToComponentMinimum(projectComponent);
}
return runner;
|
public void | setClassLoader(java.lang.ClassLoader loader)Used when called by scriptdef.
scriptLoader = loader;
|
public void | setClasspath(org.apache.tools.ant.types.Path classpath)Set the classpath to be used when searching for classes and resources.
getClassPathDelegate().setClasspath(classpath);
|
public void | setClasspathRef(org.apache.tools.ant.types.Reference r)Set the classpath by reference.
getClassPathDelegate().setClasspathref(r);
|
public void | setLanguage(java.lang.String language)Defines the language (required).
this.language = language;
|
public void | setManager(java.lang.String manager)Defines the script manager - defaults to "auto".
this.manager = manager;
|
public void | setProjectComponent(org.apache.tools.ant.ProjectComponent component)Set the project component associated with this helper.
this.projectComponent = component;
|
public void | setSetBeans(boolean setBeans)Set the setbeans attribute.
If this is true, <script> will create variables in the
script instance for all
properties, targets and references of the current project.
It this is false, only the project and self variables will
be set.
The default is true.
this.setBeans = setBeans;
|
public void | setSrc(java.io.File file)Load the script from an external file ; optional.
this.srcFile = file;
|