Class ChainReaderHelper
- java.lang.Object
- 
- org.apache.tools.ant.filters.util.ChainReaderHelper
 
- 
 public final class ChainReaderHelper extends java.lang.ObjectProcess a FilterReader chain.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description classChainReaderHelper.ChainReaderCreated type.
 - 
Field SummaryFields Modifier and Type Field Description intbufferSizeThe size of the buffer to be used.java.util.Vector<FilterChain>filterChainsChain of filtersjava.io.ReaderprimaryReaderThe primary reader to which the reader chain is to be attached.
 - 
Constructor SummaryConstructors Constructor Description ChainReaderHelper()Default constructor.ChainReaderHelper(Project project, java.io.Reader primaryReader, java.lang.Iterable<FilterChain> filterChains)Convenience constructor.
 - 
Method SummaryModifier and Type Method Description ChainReaderHelper.ChainReadergetAssembledReader()Assemble the readerProjectgetProject()Get the projectjava.lang.StringreadFully(java.io.Reader rdr)Read data from the reader and return the contents as a string.voidsetBufferSize(int size)Sets the buffer size to be used.voidsetFilterChains(java.util.Vector<FilterChain> fchain)Sets the collection of filter reader setsvoidsetPrimaryReader(java.io.Reader rdr)Sets the primaryReadervoidsetProject(Project project)Set the project to work withChainReaderHelperwith(java.util.function.Consumer<ChainReaderHelper> consumer)Fluent mechanism to apply someConsumer.ChainReaderHelperwithBufferSize(int size)Fluent buffer size mutator.ChainReaderHelperwithFilterChains(java.lang.Iterable<FilterChain> filterChains)FluentfilterChainsmutator.ChainReaderHelperwithPrimaryReader(java.io.Reader rdr)Fluent primaryReadermutator.ChainReaderHelperwithProject(Project project)FluentProjectmutator.
 
- 
- 
- 
Field Detail- 
primaryReaderpublic java.io.Reader primaryReader The primary reader to which the reader chain is to be attached.
 - 
bufferSizepublic int bufferSize The size of the buffer to be used.
 - 
filterChainspublic java.util.Vector<FilterChain> filterChains Chain of filters
 
- 
 - 
Constructor Detail- 
ChainReaderHelperpublic ChainReaderHelper() Default constructor.
 - 
ChainReaderHelperpublic ChainReaderHelper(Project project, java.io.Reader primaryReader, java.lang.Iterable<FilterChain> filterChains) Convenience constructor.- Parameters:
- project- ditto
- primaryReader- ditto
- filterChains- ditto
 
 
- 
 - 
Method Detail- 
setPrimaryReaderpublic void setPrimaryReader(java.io.Reader rdr) Sets the primaryReader- Parameters:
- rdr- the reader object
 
 - 
withPrimaryReaderpublic ChainReaderHelper withPrimaryReader(java.io.Reader rdr) Fluent primaryReadermutator.- Parameters:
- rdr- Reader
- Returns:
- this
 
 - 
setProjectpublic void setProject(Project project) Set the project to work with- Parameters:
- project- the current project
 
 - 
withProjectpublic ChainReaderHelper withProject(Project project) FluentProjectmutator.- Parameters:
- project- ditto
- Returns:
- this
 
 - 
getProjectpublic Project getProject() Get the project- Returns:
- the current project
 
 - 
setBufferSizepublic void setBufferSize(int size) Sets the buffer size to be used. Defaults to 8192, if this method is not invoked.- Parameters:
- size- the buffer size to use
 
 - 
withBufferSizepublic ChainReaderHelper withBufferSize(int size) Fluent buffer size mutator.- Parameters:
- size- ditto
- Returns:
- this
 
 - 
setFilterChainspublic void setFilterChains(java.util.Vector<FilterChain> fchain) Sets the collection of filter reader sets- Parameters:
- fchain- the filter chains collection
 
 - 
withFilterChainspublic ChainReaderHelper withFilterChains(java.lang.Iterable<FilterChain> filterChains) FluentfilterChainsmutator.- Parameters:
- filterChains- ditto
- Returns:
- this
 
 - 
withpublic ChainReaderHelper with(java.util.function.Consumer<ChainReaderHelper> consumer) Fluent mechanism to apply someConsumer.- Parameters:
- consumer- ditto
- Returns:
- this
 
 - 
getAssembledReaderpublic ChainReaderHelper.ChainReader getAssembledReader() throws BuildException Assemble the reader- Returns:
- the assembled reader
- Throws:
- BuildException- if an error occurs
 
 - 
readFullypublic java.lang.String readFully(java.io.Reader rdr) throws java.io.IOExceptionRead data from the reader and return the contents as a string.- Parameters:
- rdr- the reader object
- Returns:
- the contents of the file as a string
- Throws:
- java.io.IOException- if an error occurs
 
 
- 
 
-