org.apache.tools.ant.types

Class RedirectorElement

public class RedirectorElement extends DataType

Element representation of a Redirector.

Since: Ant 1.6.2

Method Summary
voidaddConfiguredErrorMapper(Mapper errorMapper)
Add the error file mapper.
voidaddConfiguredInputMapper(Mapper inputMapper)
Add the input file mapper.
voidaddConfiguredOutputMapper(Mapper outputMapper)
Add the output file mapper.
voidconfigure(Redirector redirector)
Configure the specified Redirector.
voidconfigure(Redirector redirector, String sourcefile)
Configure the specified Redirector for the specified sourcefile.
FilterChaincreateErrorFilterChain()
Create a nested error FilterChain.
FilterChaincreateInputFilterChain()
Create a nested input FilterChain.
protected MappercreateMergeMapper(File destfile)
Create a merge mapper pointing to the specified destination file.
FilterChaincreateOutputFilterChain()
Create a nested output FilterChain.
protected voiddieOnCircularReference(Stack stk, Project p)
Overrides the version of DataType to recurse on all DataType child elements that may have been added.
voidsetAlwaysLog(boolean alwaysLog)
If true, (error and non-error) output will be "teed", redirected as specified while being sent to Ant's logging mechanism as if no redirection had taken place.
voidsetAppend(boolean append)
Whether output should be appended to or overwrite an existing file.
voidsetCreateEmptyFiles(boolean createEmptyFiles)
Whether output and error files should be created even when empty.
voidsetError(File error)
Set the file to which standard error is to be redirected.
voidsetErrorEncoding(String errorEncoding)
Set the error encoding.
voidsetErrorProperty(String errorProperty)
Property name whose value should be set to the error of the process.
voidsetInput(File input)
Set the input to use for the task.
voidsetInputEncoding(String inputEncoding)
Set the input encoding.
voidsetInputString(String inputString)
Set the string to use as input
voidsetLogError(boolean logError)
Controls whether error output of exec is logged.
voidsetLogInputString(boolean logInputString)
Set whether to include the value of the input string in log messages.
voidsetOutput(File out)
File the output of the process is redirected to.
voidsetOutputEncoding(String outputEncoding)
Set the output encoding.
voidsetOutputProperty(String outputProperty)
Property name whose value should be set to the output of the process.
voidsetRefid(Reference r)
Make this instance in effect a reference to another instance.
protected File[]toFileArray(String[] name)
Return a File[] from the specified set of filenames.

Method Detail

addConfiguredErrorMapper

public void addConfiguredErrorMapper(Mapper errorMapper)
Add the error file mapper.

Parameters: errorMapper Mapper.

addConfiguredInputMapper

public void addConfiguredInputMapper(Mapper inputMapper)
Add the input file mapper.

Parameters: inputMapper Mapper.

addConfiguredOutputMapper

public void addConfiguredOutputMapper(Mapper outputMapper)
Add the output file mapper.

Parameters: outputMapper Mapper.

configure

public void configure(Redirector redirector)
Configure the specified Redirector.

Parameters: redirector Redirector.

configure

public void configure(Redirector redirector, String sourcefile)
Configure the specified Redirector for the specified sourcefile.

Parameters: redirector Redirector. sourcefile String.

createErrorFilterChain

public FilterChain createErrorFilterChain()
Create a nested error FilterChain.

Returns: FilterChain.

createInputFilterChain

public FilterChain createInputFilterChain()
Create a nested input FilterChain.

Returns: FilterChain.

createMergeMapper

protected Mapper createMergeMapper(File destfile)
Create a merge mapper pointing to the specified destination file.

Parameters: destfile File

Returns: Mapper.

createOutputFilterChain

public FilterChain createOutputFilterChain()
Create a nested output FilterChain.

Returns: FilterChain.

dieOnCircularReference

protected void dieOnCircularReference(Stack stk, Project p)
Overrides the version of DataType to recurse on all DataType child elements that may have been added.

Parameters: stk the stack of data types to use (recursively). p the project to use to dereference the references.

Throws: BuildException on error.

setAlwaysLog

public void setAlwaysLog(boolean alwaysLog)
If true, (error and non-error) output will be "teed", redirected as specified while being sent to Ant's logging mechanism as if no redirection had taken place. Defaults to false.

Parameters: alwaysLog boolean

Since: Ant 1.6.3

setAppend

public void setAppend(boolean append)
Whether output should be appended to or overwrite an existing file. Defaults to false.

Parameters: append if true output and error streams are appended to their respective files, if specified.

setCreateEmptyFiles

public void setCreateEmptyFiles(boolean createEmptyFiles)
Whether output and error files should be created even when empty. Defaults to true.

Parameters: createEmptyFiles boolean.

setError

public void setError(File error)
Set the file to which standard error is to be redirected.

Parameters: error the file to which error is to be written.

setErrorEncoding

public void setErrorEncoding(String errorEncoding)
Set the error encoding.

Parameters: errorEncoding String.

setErrorProperty

public void setErrorProperty(String errorProperty)
Property name whose value should be set to the error of the process.

Parameters: errorProperty the name of the property to be set with the error output.

setInput

public void setInput(File input)
Set the input to use for the task.

Parameters: input the file from which input is read.

setInputEncoding

public void setInputEncoding(String inputEncoding)
Set the input encoding.

Parameters: inputEncoding String.

setInputString

public void setInputString(String inputString)
Set the string to use as input

Parameters: inputString the string which is used as the input source

setLogError

public void setLogError(boolean logError)
Controls whether error output of exec is logged. This is only useful when output is being redirected and error output is desired in the Ant log.

Parameters: logError if true the standard error is sent to the Ant log system and not sent to output.

setLogInputString

public void setLogInputString(boolean logInputString)
Set whether to include the value of the input string in log messages. Defaults to true.

Parameters: logInputString true or false.

Since: Ant 1.7

setOutput

public void setOutput(File out)
File the output of the process is redirected to. If error is not redirected, it too will appear in the output.

Parameters: out the file to which output stream is written.

setOutputEncoding

public void setOutputEncoding(String outputEncoding)
Set the output encoding.

Parameters: outputEncoding String.

setOutputProperty

public void setOutputProperty(String outputProperty)
Property name whose value should be set to the output of the process.

Parameters: outputProperty the name of the property to be set with the task's output.

setRefid

public void setRefid(Reference r)
Make this instance in effect a reference to another instance.

You must not set another attribute or nest elements inside this element if you make it a reference.

Parameters: r the reference to use.

Throws: BuildException on error.

toFileArray

protected File[] toFileArray(String[] name)
Return a File[] from the specified set of filenames.

Parameters: name String[]

Returns: File[].