peterreilly    2003/11/12 01:36:09

  Modified:    docs/manual/CoreTypes Tag: ANT_16_BRANCH filterchain.html
  Log:
  Sync with HEAD
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.13.2.3  +18 -2     ant/docs/manual/CoreTypes/filterchain.html
  
  Index: filterchain.html
  ===================================================================
  RCS file: /home/cvs/ant/docs/manual/CoreTypes/filterchain.html,v
  retrieving revision 1.13.2.2
  retrieving revision 1.13.2.3
  diff -u -r1.13.2.2 -r1.13.2.3
  --- filterchain.html  15 Oct 2003 17:56:37 -0000      1.13.2.2
  +++ filterchain.html  12 Nov 2003 09:36:08 -0000      1.13.2.3
  @@ -1261,6 +1261,8 @@
   <p>
   The script is provided with an object <i>self</i> that has
   getToken() and setToken(String) methods.
  +The getToken() method returns the current token. The setToken(String)
  +method replaces the current token.
   </p>
   
   This filter may be used directly within a filterchain.<p>
  @@ -1287,15 +1289,29 @@
   
   <H4>Examples:</H4>
   
  -Convert to uppercase.
  +Convert to uppercase:
   <BLOCKQUOTE><PRE>
   &lt;tokenfilter&gt;
       &lt;scriptfilter language="javascript"&gt;
           self.setToken(self.getToken().toUpperCase());
       &lt;/scriptfilter&gt;
   &lt;/tokenfilter&gt;
  -
   </PRE></BLOCKQUOTE>
  +
  +Remove lines containing the string "bad" while
  +copying text files:
  +  <blockquote>
  +    <pre>
  +&lt;copy todir="dist"&gt;
  +  &lt;fileset dir="src" includes="**/*.txt"/&gt;
  +  &lt;scriptfilter language="beanshell"&gt;
  +      if (self.getToken().indexOf("bad") != -1) {
  +          self.setToken(null);
  +      }
  +  &lt;/scriptfilter&gt;
  +&lt;/copy&gt;
  +    </pre>
  +  </blockquote>
   
   <H4>Custom tokenizers and string filters</H4>
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to