org.apache.tools.ant.types.optional
Class ScriptFilter
- ChainableReader, Cloneable, TokenFilter.Filter
public class ScriptFilter
Most of this is CAP (Cut And Paste) from the Script task
ScriptFilter class, implements TokenFilter.Filter
for scripts to use.
This provides the same beans as the Script Task
to a script.
The script is meant to use get self.token and
set self.token in the reply.
void | addText(String text) - The script text.
|
Path | createClasspath() - Classpath to be used when searching for classes and resources.
|
String | filter(String token) - Called filter the token.
|
String | getToken() - The current token
|
void | setClasspath(Path classpath) - Set the classpath to be used when searching for classes and resources.
|
void | setClasspathRef(Reference r) - Set the classpath by reference.
|
void | setLanguage(String language) - Defines the language (required).
|
void | setManager(String manager) - Defines the manager.
|
void | setProject(Project project) - Set the project.
|
void | setSrc(File file) - Load the script from an external file ; optional.
|
void | setToken(String token) - The current token
|
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.
filter
public String filter(String token)
Called filter the token.
This sets the token in this object, calls
the script and returns the token.
- filter in interface TokenFilter.Filter
token
- the token to be filtered
getToken
public String getToken()
The current token
- the string filtered by the script
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.
setToken
public void setToken(String token)
The current token
token
- the string filtered by the script