|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Dictionary | +--java.util.Hashtable | +--org.apache.ecs.filter.CharacterFilter
This class creates a Filter object. The default characters filtered are:
" ' & < >
For example:
Filter filter = new CharacterFilter();
filter.addAttribute("$","dollar");
filter.addAttribute("#",Entities.POUND);
P p = new P();
p.setFilter(filter);
Document doc = new Document();
doc.getBody().addElement(p);
The filter is applied when the addElement() method is called.
Inner classes inherited from class java.util.Map |
java.util.Map.Entry |
Fields inherited from class java.util.Hashtable |
count, emptyEnumerator, emptyIterator, ENTRIES, entrySet, KEYS, keySet, loadFactor, modCount, serialVersionUID, table, threshold, values, VALUES |
Constructor Summary | |
CharacterFilter()
|
Method Summary | |
(package private) void |
Private initializer. |
Filter |
addAttribute(java.lang.String name,
java.lang.Object attribute)
Register things to be filtered. |
java.lang.String |
getInfo()
Returns the name of the filter |
boolean |
hasAttribute(java.lang.String key)
Check to see if something is going to be filtered. |
java.lang.String |
process(java.lang.String to_process)
Perform the filtering operation. |
Filter |
removeAttribute(java.lang.String name)
Remove things to be filtered. |
Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, getEnumeration, getIterator, hashCode, isEmpty, keys, keySet, put, putAll, readObject, rehash, remove, size, toString, values, writeObject |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait |
Constructor Detail |
public CharacterFilter()
Method Detail |
void()
in class java.util.Hashtable
public java.lang.String getInfo()
getInfo
in interface Filter
public Filter addAttribute(java.lang.String name, java.lang.Object attribute)
addAttribute
in interface Filter
public Filter removeAttribute(java.lang.String name)
removeAttribute
in interface Filter
public boolean hasAttribute(java.lang.String key)
hasAttribute
in interface Filter
public java.lang.String process(java.lang.String to_process)
process
in interface Filter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |