ParallelFilter

Description

Parallelfilter is used to split the input stream in two or branch it. The input will be forwarded unchanged to the next filter in the chain but it will also be the source of the nested filterchain. The aim of the filterreader is to be able to parse only once the input files and apply many different filtering at once.
The schema below shows the concept. A star sign represents the start or the end of a filterchain. A plus sign represents one filter.
           parallelfilter
*----+------------+---------+----------+------------+---------*
                  |
                  *-------+-----+--------+------*
There is an implicit stopfilter at the end of the nested filterchain

Definition

Using typedef:
<typedef name="parallelfilter"
         classname="net.sf.antcount.filters.ParallelFilter"
         classpath="antcount.jar" />
Using inline definition with filterreader:
<filterreader classname="net.sf.antcount.filters.ParallelFilter"
         classpath="antcount.jar" />

Attributes

No attributes.

Nested elements

filterchain

This filterchain will receive a copy of the incoming stream. See the filterchain manual page for more information on this element.

Examples

The following will output what's being input without any change but it will also write into a file bbb.txt the same input, replacing all 'aaa' by 'bbb'.

<filterchain>
  <parallelfilter>
    <tokenfilter>
      <replacestring from="aaa" to="bbb" />
    </tokenfilter>
    <echo file="bbb.txt"/>
  </parallelfilter>
</filterchain>