org.jwarp.util.filter
Class CharacterFilter

java.lang.Object
  |
  +--java.util.Dictionary
        |
        +--java.util.Hashtable
              |
              +--org.jwarp.util.filter.CharacterFilter
All Implemented Interfaces:
java.lang.Cloneable, IFilter, java.util.Map, java.io.Serializable

public class CharacterFilter
extends java.util.Hashtable
implements IFilter

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.

Version:
$Id: CharacterFilter.java,v 1.4 1999/11/30 06:00:35 stephan Exp $
Author:
Stephan Nagy, Jon S. Stevens
See Also:
Serialized Form

Inner classes inherited from class java.util.Map
java.util.Map.Entry
 
Constructor Summary
CharacterFilter()
           
 
Method Summary
(package private)  void ()
          Private initializer.
 IFilter addAttribute(java.lang.String name, java.lang.Object attribute)
          Register things to be filtered.
 java.lang.String filter(java.lang.String input)
          Perform the filtering operation.
 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.
 IFilter 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, 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

CharacterFilter

public CharacterFilter()
Method Detail

void ()
Private initializer.
Overrides:
in class java.util.Hashtable

getInfo

public java.lang.String getInfo()
Returns the name of the filter

addAttribute

public IFilter addAttribute(java.lang.String name,
                            java.lang.Object attribute)
Register things to be filtered.

removeAttribute

public IFilter removeAttribute(java.lang.String name)
Remove things to be filtered.

hasAttribute

public boolean hasAttribute(java.lang.String key)
Check to see if something is going to be filtered.

filter

public java.lang.String filter(java.lang.String input)
Perform the filtering operation.

©   O R C A   S y s t e m s