Package org.apache.tools.ant.filters
Class ConcatFilter
- java.lang.Object
- 
- java.io.Reader
- 
- java.io.FilterReader
- 
- org.apache.tools.ant.filters.BaseFilterReader
- 
- org.apache.tools.ant.filters.BaseParamFilterReader
- 
- org.apache.tools.ant.filters.ConcatFilter
 
 
 
 
 
- 
- All Implemented Interfaces:
- java.io.Closeable,- java.lang.AutoCloseable,- java.lang.Readable,- ChainableReader,- Parameterizable
 
 public final class ConcatFilter extends BaseParamFilterReader implements ChainableReader Concats a file before and/or after the file.Example: <copy todir="build"> <fileset dir="src" includes="*.java"/> <filterchain> <concatfilter prepend="apache-license-java.txt"/> </filterchain> </copy>Copies all java sources from src to build and adds the content of apache-license-java.txt add the beginning of each file. - Since:
- 1.6
- Version:
- 2003-09-23
 
- 
- 
Constructor SummaryConstructors Constructor Description ConcatFilter()Constructor for "dummy" instances.ConcatFilter(java.io.Reader in)Creates a new filtered reader.
 - 
Method SummaryModifier and Type Method Description java.io.Readerchain(java.io.Reader rdr)Creates a new ConcatReader using the passed in Reader for instantiation.java.io.FilegetAppend()Returns append attribute.java.io.FilegetPrepend()Returns prepend attribute.intread()Returns the next character in the filtered stream.voidsetAppend(java.io.File append)Sets append attribute.voidsetPrepend(java.io.File prepend)Sets prepend attribute.- 
Methods inherited from class org.apache.tools.ant.filters.BaseParamFilterReadergetParameters, setParameters
 - 
Methods inherited from class org.apache.tools.ant.filters.BaseFilterReadergetInitialized, getProject, read, readFully, readLine, setInitialized, setProject, skip
 
- 
 
- 
- 
- 
Constructor Detail- 
ConcatFilterpublic ConcatFilter() Constructor for "dummy" instances.- See Also:
- BaseFilterReader()
 
 - 
ConcatFilterpublic ConcatFilter(java.io.Reader in) Creates a new filtered reader.- Parameters:
- in- A Reader object providing the underlying stream. Must not be- null.
 
 
- 
 - 
Method Detail- 
readpublic int read() throws java.io.IOExceptionReturns the next character in the filtered stream. If the desired number of lines have already been read, the resulting stream is effectively at an end. Otherwise, the next character from the underlying stream is read and returned.- Overrides:
- readin class- java.io.FilterReader
- Returns:
- the next character in the resulting stream, or -1 if the end of the resulting stream has been reached
- Throws:
- java.io.IOException- if the underlying stream throws an IOException during reading
 
 - 
setPrependpublic void setPrepend(java.io.File prepend) Sets prepend attribute.- Parameters:
- prepend- new value
 
 - 
getPrependpublic java.io.File getPrepend() Returns prepend attribute.- Returns:
- prepend attribute
 
 - 
setAppendpublic void setAppend(java.io.File append) Sets append attribute.- Parameters:
- append- new value
 
 - 
getAppendpublic java.io.File getAppend() Returns append attribute.- Returns:
- append attribute
 
 - 
chainpublic java.io.Reader chain(java.io.Reader rdr) Creates a new ConcatReader using the passed in Reader for instantiation.- Specified by:
- chainin interface- ChainableReader
- Parameters:
- rdr- A Reader object providing the underlying stream. Must not be- null.
- Returns:
- a new filter based on this configuration, but filtering the specified reader
 
 
- 
 
-