Class AbstractScriptComponent
- java.lang.Object
- 
- org.apache.tools.ant.ProjectComponent
- 
- org.apache.tools.ant.types.optional.AbstractScriptComponent
 
 
- 
- All Implemented Interfaces:
- java.lang.Cloneable
 - Direct Known Subclasses:
- ScriptCondition,- ScriptMapper
 
 public abstract class AbstractScriptComponent extends ProjectComponent This is aProjectComponentthat has script support built in Use it as a foundation for scriptable things.
- 
- 
Field Summary- 
Fields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
 
- 
 - 
Constructor SummaryConstructors Constructor Description AbstractScriptComponent()
 - 
Method SummaryModifier and Type Method Description voidaddText(java.lang.String text)The script text.PathcreateClasspath()Classpath to be used when searching for classes and resources.protected voidexecuteScript(java.lang.String execName)Run a scriptScriptRunnerBasegetRunner()Get our script runnerprotected voidinitScriptRunner()Initialize the script runner.voidsetClasspath(Path classpath)Set the classpath to be used when searching for classes and resources.voidsetClasspathRef(Reference r)Set the classpath by reference.voidsetEncoding(java.lang.String encoding)Set the encoding of the script from an external file; optional.voidsetLanguage(java.lang.String language)Defines the language (required).voidsetManager(java.lang.String manager)Defines the manager.voidsetProject(Project project)Set the project.voidsetSetBeans(boolean setBeans)Set the setbeans attribute.voidsetSrc(java.io.File file)Load the script from an external file; optional.- 
Methods inherited from class org.apache.tools.ant.ProjectComponentclone, getDescription, getLocation, getProject, log, log, setDescription, setLocation
 
- 
 
- 
- 
- 
Method Detail- 
setProjectpublic void setProject(Project project) Set the project.- Overrides:
- setProjectin class- ProjectComponent
- Parameters:
- project- the owner of this component.
 
 - 
getRunnerpublic ScriptRunnerBase getRunner() Get our script runner- Returns:
- the runner
 
 - 
setSrcpublic void setSrc(java.io.File file) Load the script from an external file; optional.- Parameters:
- file- the file containing the script source.
 
 - 
addTextpublic void addText(java.lang.String text) The script text.- Parameters:
- text- a component of the script text to be added.
 
 - 
setManagerpublic void setManager(java.lang.String manager) Defines the manager.- Parameters:
- manager- the scripting manager.
 
 - 
setLanguagepublic void setLanguage(java.lang.String language) Defines the language (required).- Parameters:
- language- the scripting language name for the script.
 
 - 
initScriptRunnerprotected void initScriptRunner() Initialize the script runner. Calls this before running the system
 - 
setClasspathpublic void setClasspath(Path classpath) Set the classpath to be used when searching for classes and resources.- Parameters:
- classpath- an Ant Path object containing the search path.
 
 - 
createClasspathpublic Path createClasspath() Classpath to be used when searching for classes and resources.- Returns:
- an empty Path instance to be configured by Ant.
 
 - 
setClasspathRefpublic void setClasspathRef(Reference r) Set the classpath by reference.- Parameters:
- r- a Reference to a Path instance to be used as the classpath value.
 
 - 
executeScriptprotected void executeScript(java.lang.String execName) Run a script- Parameters:
- execName- name of the script
 
 - 
setSetBeanspublic 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.- Parameters:
- setBeans- the value to set.
- Since:
- Ant 1.8.0
 
 - 
setEncodingpublic void setEncoding(java.lang.String encoding) Set the encoding of the script from an external file; optional.- Parameters:
- encoding- the encoding of the file containing the script source.
- Since:
- Ant 1.10.2
 
 
- 
 
-