Package org.apache.tools.ant.types
Class RedirectorElement
- java.lang.Object
- 
- org.apache.tools.ant.ProjectComponent
- 
- org.apache.tools.ant.types.DataType
- 
- org.apache.tools.ant.types.RedirectorElement
 
 
 
- 
- All Implemented Interfaces:
- java.lang.Cloneable
 
 public class RedirectorElement extends DataType Element representation of aRedirector.- Since:
- Ant 1.6.2
 
- 
- 
Field Summary- 
Fields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
 
- 
 - 
Constructor SummaryConstructors Constructor Description RedirectorElement()
 - 
Method SummaryModifier and Type Method Description 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 specifiedRedirector.voidconfigure(Redirector redirector, java.lang.String sourcefile)Configure the specifiedRedirectorfor the specified sourcefile.FilterChaincreateErrorFilterChain()Create a nested errorFilterChain.FilterChaincreateInputFilterChain()Create a nested inputFilterChain.protected MappercreateMergeMapper(java.io.File destfile)Create a merge mapper pointing to the specified destination file.FilterChaincreateOutputFilterChain()Create a nested outputFilterChain.protected voiddieOnCircularReference(java.util.Stack<java.lang.Object> 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.voidsetBinaryOutput(boolean b)Whether to consider the output created by the process binary.voidsetCreateEmptyFiles(boolean createEmptyFiles)Whether output and error files should be created even when empty.voidsetError(java.io.File error)Set the file to which standard error is to be redirected.voidsetErrorEncoding(java.lang.String errorEncoding)Set the error encoding.voidsetErrorProperty(java.lang.String errorProperty)Property name whose value should be set to the error of the process.voidsetInput(java.io.File input)Set the input to use for the task.voidsetInputEncoding(java.lang.String inputEncoding)Set the input encoding.voidsetInputString(java.lang.String inputString)Set the string to use as inputvoidsetLogError(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(java.io.File out)File the output of the process is redirected to.voidsetOutputEncoding(java.lang.String outputEncoding)Set the output encoding.voidsetOutputProperty(java.lang.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 java.io.File[]toFileArray(java.lang.String[] name)Return aFile[]from the specified set of filenames.- 
Methods inherited from class org.apache.tools.ant.types.DataTypecheckAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributes, toString
 - 
Methods inherited from class org.apache.tools.ant.ProjectComponentgetDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
 
- 
 
- 
- 
- 
Method Detail- 
addConfiguredInputMapperpublic void addConfiguredInputMapper(Mapper inputMapper) Add the input file mapper.- Parameters:
- inputMapper-- Mapper.
 
 - 
addConfiguredOutputMapperpublic void addConfiguredOutputMapper(Mapper outputMapper) Add the output file mapper.- Parameters:
- outputMapper-- Mapper.
 
 - 
addConfiguredErrorMapperpublic void addConfiguredErrorMapper(Mapper errorMapper) Add the error file mapper.- Parameters:
- errorMapper-- Mapper.
 
 - 
setRefidpublic void setRefid(Reference r) throws BuildException 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. - Overrides:
- setRefidin class- DataType
- Parameters:
- r- the reference to use.
- Throws:
- BuildException- on error.
 
 - 
setInputpublic void setInput(java.io.File input) Set the input to use for the task.- Parameters:
- input- the file from which input is read.
 
 - 
setInputStringpublic void setInputString(java.lang.String inputString) Set the string to use as input- Parameters:
- inputString- the string which is used as the input source
 
 - 
setLogInputStringpublic 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
 
 - 
setOutputpublic void setOutput(java.io.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.
 
 - 
setOutputEncodingpublic void setOutputEncoding(java.lang.String outputEncoding) Set the output encoding.- Parameters:
- outputEncoding-- String.
 
 - 
setErrorEncodingpublic void setErrorEncoding(java.lang.String errorEncoding) Set the error encoding.- Parameters:
- errorEncoding-- String.
 
 - 
setInputEncodingpublic void setInputEncoding(java.lang.String inputEncoding) Set the input encoding.- Parameters:
- inputEncoding-- String.
 
 - 
setLogErrorpublic 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.
 
 - 
setErrorpublic void setError(java.io.File error) Set the file to which standard error is to be redirected.- Parameters:
- error- the file to which error is to be written.
 
 - 
setOutputPropertypublic void setOutputProperty(java.lang.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.
 
 - 
setAppendpublic 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.
 
 - 
setAlwaysLogpublic 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
 
 - 
setCreateEmptyFilespublic void setCreateEmptyFiles(boolean createEmptyFiles) Whether output and error files should be created even when empty. Defaults to true.- Parameters:
- createEmptyFiles-- boolean.
 
 - 
setErrorPropertypublic void setErrorProperty(java.lang.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.
 
 - 
createInputFilterChainpublic FilterChain createInputFilterChain() Create a nested inputFilterChain.- Returns:
- FilterChain.
 
 - 
createOutputFilterChainpublic FilterChain createOutputFilterChain() Create a nested outputFilterChain.- Returns:
- FilterChain.
 
 - 
createErrorFilterChainpublic FilterChain createErrorFilterChain() Create a nested errorFilterChain.- Returns:
- FilterChain.
 
 - 
setBinaryOutputpublic void setBinaryOutput(boolean b) Whether to consider the output created by the process binary.Binary output will not be split into lines which may make error and normal output look mixed up when they get written to the same stream. - Parameters:
- b- boolean
- Since:
- 1.9.4
 
 - 
configurepublic void configure(Redirector redirector) Configure the specifiedRedirector.- Parameters:
- redirector-- Redirector.
 
 - 
configurepublic void configure(Redirector redirector, java.lang.String sourcefile) Configure the specifiedRedirectorfor the specified sourcefile.- Parameters:
- redirector-- Redirector.
- sourcefile-- String.
 
 - 
createMergeMapperprotected Mapper createMergeMapper(java.io.File destfile) Create a merge mapper pointing to the specified destination file.- Parameters:
- destfile-- File
- Returns:
- Mapper.
 
 - 
toFileArrayprotected java.io.File[] toFileArray(java.lang.String[] name) Return aFile[]from the specified set of filenames.- Parameters:
- name-- String[]
- Returns:
- File[].
 
 - 
dieOnCircularReferenceprotected void dieOnCircularReference(java.util.Stack<java.lang.Object> stk, Project p) throws BuildExceptionOverrides the version of DataType to recurse on all DataType child elements that may have been added.- Overrides:
- dieOnCircularReferencein class- DataType
- Parameters:
- stk- the stack of data types to use (recursively).
- p- the project to use to dereference the references.
- Throws:
- BuildException- on error.
 
 
- 
 
-