org.apache.tools.ant.types.optional

Class ScriptFilter

public class ScriptFilter extends TokenFilter.ChainableReaderFilter

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.

Since: Ant 1.6

Method Summary
voidaddText(String text)
The script text.
Stringfilter(String token)
Called filter the token.
StringgetToken()
The current token
voidsetLanguage(String language)
Defines the language (required).
voidsetSrc(File file)
Load the script from an external file ; optional.
voidsetToken(String token)
The current token

Method Detail

addText

public void addText(String text)
The script text.

Parameters: text a component of the script text to be added.

filter

public String filter(String token)
Called filter the token. This sets the token in this object, calls the script and returns the token.

Parameters: token the token to be filtered

Returns: the filtered token

getToken

public String getToken()
The current token

Returns: the string filtered by the script

setLanguage

public void setLanguage(String language)
Defines the language (required).

Parameters: language the scripting language name for the script.

setSrc

public void setSrc(File file)
Load the script from an external file ; optional.

Parameters: file the file containing the script source.

setToken

public void setToken(String token)
The current token

Parameters: token the string filtered by the script

Copyright