Package org.apache.tools.ant.util
Class ScriptRunnerHelper
java.lang.Object
org.apache.tools.ant.util.ScriptRunnerHelper
A class to help in creating, setting and getting script runners.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidadd(ResourceCollection resource) Add any source resource.voidAdd script text.Classpath to be used when searching for classes and resources.booleanGet the compilation feature.Get the external file encoding.Get the language.Create and set text on a script.getSrc()Get the external script file; optional.voidsetClassLoader(ClassLoader loader) Used when called by scriptdef.voidsetClasspath(Path classpath) Set the classpath to be used when searching for classes and resources.voidSet the classpath by reference.voidsetCompiled(boolean compiled) Enable the compilation of the script if possible.voidsetEncoding(String encoding) Set the encoding of the script from an external file; optional.voidsetLanguage(String language) Defines the language (required).voidsetManager(String manager) Deprecated.voidsetManager(ScriptManager manager) Set the manager.voidsetProjectComponent(ProjectComponent component) Set the project component associated with this helper.voidsetSetBeans(boolean setBeans) Set the setbeans attribute.voidLoad the script from an external file; optional.
- 
Constructor Details- 
ScriptRunnerHelperpublic ScriptRunnerHelper()
 
- 
- 
Method Details- 
setProjectComponentSet the project component associated with this helper.- Parameters:
- component- the project component that owns this helper.
 
- 
getScriptRunnerCreate and set text on a script.- Returns:
- the created or reused script runner.
 
- 
createClasspathClasspath to be used when searching for classes and resources.- Returns:
- an empty Path instance to be configured by Ant.
 
- 
setClasspathSet the classpath to be used when searching for classes and resources.- Parameters:
- classpath- an Ant Path object containing the search path.
 
- 
setClasspathRefSet the classpath by reference.- Parameters:
- r- a Reference to a Path instance to be used as the classpath value.
 
- 
setSrcLoad the script from an external file; optional.- Parameters:
- file- the file containing the script source.
 
- 
getSrcGet the external script file; optional.- Returns:
- the file containing the script source.
- Since:
- Ant 1.10.2
 
- 
setEncodingSet 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
 
- 
getEncodingGet the external file encoding.- Returns:
- the encoding of the file containing the script source.
- Since:
- Ant 1.10.2
 
- 
addTextAdd script text.- Parameters:
- text- a component of the script text to be added.
 
- 
setManagerDeprecated.Defines the script manager - defaults to "auto".- Parameters:
- manager- the scripting manager - "bsf" or "javax" or "auto"
 
- 
setManagerSet the manager.- Parameters:
- manager-
 
- 
setLanguageDefines the language (required).- Parameters:
- language- the scripting language name for the script.
 
- 
getLanguageGet the language.- Returns:
- the scripting language.
 
- 
setCompiledpublic void setCompiled(boolean compiled) Enable the compilation of the script if possible. If this is true and the compilation feature is available in the script engine, the script is compiled before the first evaluation, and should be cached for future evaluations. Otherwise, the script is evaluated each time. The default is false.- Parameters:
- compiled- the value to set.
 
- 
getCompiledpublic boolean getCompiled()Get the compilation feature.- Returns:
- the compilation feature.
 
- 
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.
 
- 
setClassLoaderUsed when called by scriptdef.- Parameters:
- loader- the loader used by scriptdef.
 
- 
addAdd any source resource.- Parameters:
- resource- source of script
- Since:
- Ant 1.7.1
 
 
-