StopFilter

Description

Stopfilter is used to stop all input. It is useful for using the 'concat' ant task without writing in an output file.
The 'contains' and 'match' attributes can be used to start stoping when getting an input that match a criteria.

Definition

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

Attributes

Name Description Required Default
contains If this is set, the input will be stopped only once an input contained the specified string. No All input is blocked
match If this regular expression is set, the input will be stopped only once an input matched this regular expression. No All input is blocked

Examples

Stop all input. This means that we will count all lines, but nothing will get printed in the console:

<concat>
  <fileset dir="${log.dir}" includes="**/*.log" />
  <filterchain>
    <tokenfilter>
      <countfilter property="nb.lines" />
    </tokenfilter>
    <stopfilter />
  </filterchain>
</concat>


Stop all input, starting at the first line containing 'xxx. This means that we will count all lines, but only the lines before the one containing 'xxx' will be printed on the console:

<concat>
  <fileset dir="${log.dir}" includes="**/*.log" />
  <filterchain>
    <tokenfilter>
      <countfilter property="nb.lines" />
    </tokenfilter>
    <stopfilter contains="xxx" />
  </filterchain>
</concat>