Expresso 5-6

com.jcorporate.expresso.core.security.filters
Class FilterTreeNode

java.lang.Object
  extended bycom.jcorporate.expresso.core.security.filters.FilterTreeNode
All Implemented Interfaces:
Serializable

public class FilterTreeNode
extends Object
implements Serializable

This class provides a "filter parse tree" interface to the system. It is a dual action object, it's a union of a node, and a leaf. Thus allowing us to play with TreeMap/HashMap quickly.

Please Note: This class is unsynchronized for performance reasons, please be careful when using in a multi-threaded environment outisde of the Filter class.

Author:
Michael Rimov
See Also:
Serialized Form

Constructor Summary
FilterTreeNode()
           
 
Method Summary
 void dumpNode()
          Dumps a printout of the node and subnodes to System.out
 void dumpNode(org.apache.log4j.Category log)
          Dumps the contents of the tree to the log.
 void dumpNode(FastStringBuffer stringBuffer, int depth)
          Dumps the contents of the tree to the log.
 String getReplacementString()
           
 FilterTreeNode getSubnode(ReusableChar key)
           
 void setReplacementString(String newReplacementString)
          Should be only called be the parse tree builder Set the replacement string that corresponds to this node
 void setSubnode(ReusableChar key, FilterTreeNode newSubnode)
          Set a subnode based upon the character key.
 boolean subnodeExists(ReusableChar key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterTreeNode

public FilterTreeNode()
Method Detail

getReplacementString

public String getReplacementString()
Returns:
A replacement string if it exists at this node. otherwise null

setReplacementString

public void setReplacementString(String newReplacementString)
                          throws Exception
Should be only called be the parse tree builder Set the replacement string that corresponds to this node

Parameters:
newReplacementString - The replacement string to put at this node
Throws:
Exception - if a replacement string already exists for this

setSubnode

public void setSubnode(ReusableChar key,
                       FilterTreeNode newSubnode)
                throws Exception
Set a subnode based upon the character key. Should be only called by the parse tree builder.

Parameters:
key - The character key to look up the subnode.
Throws:
Exception

subnodeExists

public boolean subnodeExists(ReusableChar key)
Returns:
true if a subnode exists for this key.

getSubnode

public FilterTreeNode getSubnode(ReusableChar key)
Parameters:
key - The key to base this subnode after.
Returns:
the subnode that exists at this key, or null if it doesn't exist

dumpNode

public void dumpNode(org.apache.log4j.Category log)
Dumps the contents of the tree to the log. (ie dumps this node and all subnodes.


dumpNode

public void dumpNode()
Dumps a printout of the node and subnodes to System.out


dumpNode

public void dumpNode(FastStringBuffer stringBuffer,
                     int depth)
Dumps the contents of the tree to the log. uses depth to format how many tabs in


Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.