org.apache.tools.ant.filters.util

Class ChainReaderHelper

public final class ChainReaderHelper extends Object

Process a FilterReader chain.
Field Summary
intbufferSize
The size of the buffer to be used.
VectorfilterChains
Chain of filters
ReaderprimaryReader
The primary reader to which the reader chain is to be attached.
Method Summary
ReadergetAssembledReader()
Assemble the reader
ProjectgetProject()
Get the project
StringreadFully(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(Vector fchain)
Sets the collection of filter reader sets
voidsetPrimaryReader(Reader rdr)
Sets the primary reader
voidsetProject(Project project)
Set the project to work with

Field Detail

bufferSize

public int bufferSize
The size of the buffer to be used.

filterChains

public Vector filterChains
Chain of filters

primaryReader

public Reader primaryReader
The primary reader to which the reader chain is to be attached.

Method Detail

getAssembledReader

public Reader getAssembledReader()
Assemble the reader

Returns: the assembled reader

Throws: BuildException if an error occurs

getProject

public Project getProject()
Get the project

Returns: the current project

readFully

public String readFully(Reader rdr)
Read 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: IOException if an error occurs

setBufferSize

public 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

setFilterChains

public void setFilterChains(Vector fchain)
Sets the collection of filter reader sets

Parameters: fchain the filter chains collection

setPrimaryReader

public void setPrimaryReader(Reader rdr)
Sets the primary reader

Parameters: rdr the reader object

setProject

public void setProject(Project project)
Set the project to work with

Parameters: project the current project