ChainReaderHelper

Process a FilterReader chain.

Here, the interesting method is 'getAssembledReader'. The purpose of this one is to create a simple Reader object which apply all filters on another primary Reader object.

For example : In copyFile (phing.util.FileUtils) the primary Reader is a FileReader object (more accuratly, a BufferedReader) previously setted for the source file to copy. So, consider this filterchain :

<filterchain>
   <stripphpcomments />
   <linecontains>
       <contains value="foo">
   </linecontains>
 <tabtospaces tablength="8" />

getAssembledReader will return a Reader object wich read on each of these filters. Something like this : ('->' = 'which read data from') :

[TABTOSPACES] -> [LINECONTAINS] -> [STRIPPHPCOMMENTS] -> [FILEREADER] (primary reader)

So, getAssembledReader will return the TABTOSPACES Reader object. Then each read done with this Reader object will follow this path.

Hope this explanation is clear :)

TODO: Implement the classPath feature.

author

Yannick Lecaillez

version

$Id: 1f4ec2e465cfab96aab1df8ff8aaba0e69e984ac $

package

phing.filters.util

Methods

getAssembledReader

getAssembledReader() : \FilterReader|null|\Parameterizable|\Reader
Throws
\Exception

Response

\FilterReader|null|\Parameterizable|\Reader

getProject

getProject() 

setBufferSize

setBufferSize( $size) 

Arguments

$size

setFilterChains

setFilterChains( &$fchain) 

Arguments

$fchain

setPrimaryReader

setPrimaryReader(\Reader $reader) 

Arguments

$reader

\Reader

setProject

setProject(\Project $project) 

Arguments

$project

\Project

Properties

Primary reader to wich the reader chain is to be attached

primaryReader : 

Type(s)

The site of the buffer to be used.

bufferSize : 

Type(s)

Chain of filters

filterChains : 

Type(s)

The Phing project

project : 

Type(s)