|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Dictionary
java.util.Hashtable
org.apache.ecs.filter.WordFilter
public class WordFilter
This filter uses StringTokenizer to create "words" and allow you to replace on those "words". A word is defined as anything between two spaces. This filter should be relatively fast and shows how easy it is to implement your own filters.
Filter filter = new WordFilter();
filter.addAttribute("there","where");
filter.addAttribute("it","is");
filter.addAttribute("goes","it");
P p = new P();
p.setFilter(filter);
p.addElement("there it goes");
System.out.println(p.toString());
Produces: <p>where is it
Constructor Summary | |
---|---|
WordFilter()
|
Method Summary | |
---|---|
Filter |
addAttribute(java.lang.String attribute,
java.lang.Object entity)
Put a filter somewhere we can get to it. |
java.lang.String |
getInfo()
Returns the name of the filter |
boolean |
hasAttribute(java.lang.String attribute)
Does the filter filter this? |
java.lang.String |
process(java.lang.String to_process)
this method actually performs the filtering. |
Filter |
removeAttribute(java.lang.String attribute)
Get rid of a current filter. |
Methods inherited from class java.util.Hashtable |
---|
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WordFilter()
Method Detail |
---|
public java.lang.String getInfo()
getInfo
in interface Filter
public java.lang.String process(java.lang.String to_process)
process
in interface Filter
public Filter addAttribute(java.lang.String attribute, java.lang.Object entity)
addAttribute
in interface Filter
public Filter removeAttribute(java.lang.String attribute)
removeAttribute
in interface Filter
public boolean hasAttribute(java.lang.String attribute)
hasAttribute
in interface Filter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |