|
|
@@ -1260,6 +1260,8 @@ an explanation of scripts and dependencies. |
|
|
|
<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> |
|
|
@@ -1286,16 +1288,30 @@ Must be a supported Apache BSF language</TD> |
|
|
|
|
|
|
|
<H4>Examples:</H4> |
|
|
|
|
|
|
|
Convert to uppercase. |
|
|
|
Convert to uppercase: |
|
|
|
<BLOCKQUOTE><PRE> |
|
|
|
<tokenfilter> |
|
|
|
<scriptfilter language="javascript"> |
|
|
|
self.setToken(self.getToken().toUpperCase()); |
|
|
|
</scriptfilter> |
|
|
|
</tokenfilter> |
|
|
|
|
|
|
|
</PRE></BLOCKQUOTE> |
|
|
|
|
|
|
|
Remove lines containing the string "bad" while |
|
|
|
copying text files: |
|
|
|
<blockquote> |
|
|
|
<pre> |
|
|
|
<copy todir="dist"> |
|
|
|
<fileset dir="src" includes="**/*.txt"/> |
|
|
|
<scriptfilter language="beanshell"> |
|
|
|
if (self.getToken().indexOf("bad") != -1) { |
|
|
|
self.setToken(null); |
|
|
|
} |
|
|
|
</scriptfilter> |
|
|
|
</copy> |
|
|
|
</pre> |
|
|
|
</blockquote> |
|
|
|
|
|
|
|
<H4>Custom tokenizers and string filters</H4> |
|
|
|
|
|
|
|
Custom string filters and tokenizers may be plugged in by |
|
|
|