com.raritantechnologies.utils.tree.filter
Class AddTreeNodeFilter

java.lang.Object
  extended bycom.raritantechnologies.utils.tree.filter.AddTreeNodeFilter
All Implemented Interfaces:
IConfigurable, ITreeFilter

public class AddTreeNodeFilter
extends java.lang.Object
implements ITreeFilter

Inserts a tree node into a Tree.

The new tree node is added to an identified parent node. Child nodes of the parent node that match an optional ITreeNodeComparator are re-parented to the newly inserted node.

XML Configuration Template:
   <TreeFilter class="com.raritantechnologies.utils.filter.AddTreeNodeFilter"
                  parentIsRoot="[ true | false( default ) ]"
                  parentNodeID="[ node ID of parent node - if parentIsRoot is set to false ]"
                  newNodeName="[ name of new TreeNode to be inserted ]" >

     <!-- An optional ITreeNodeComparator to determine which child  -->
     <!-- nodes will be re-parented to the newly inserted TreeNode. -->
     <TreeNodeComparator class="[ class of com.raritantechnologies.utils.tree.ITreeNodeComparator ]" >

     </TreeNodeComparator>

     <!-- Optional set of attributes that will be added to the newly created TreeNode -->
     <Attributes>
       <Attribute name="[ name of attribute ]" value="[ value of attribute ]" />
       <!-- etc. . . -->
     </Attributes>
   </TreeFilter>

 

Developed by Raritan Technologies Inc..

Author:
Ted Sullivan

Field Summary
 
Fields inherited from interface com.raritantechnologies.utils.tree.ITreeFilter
TEMPLATE
 
Constructor Summary
AddTreeNodeFilter()
           
 
Method Summary
 TreeNode filterNode(TreeNode node, TreeRoot sourceTree, RaritanPageContext rpc)
           
 TreeRoot filterTree(TreeRoot tree, RaritanPageContext rpc)
          Filter (prune, add, modify etc.) a Tree object.
 java.lang.String getConfigurationXML()
           
 java.lang.String getConfigurationXML(java.lang.String configurationTemplate)
           
 void getConfigurationXML(java.io.Writer writer)
           
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddTreeNodeFilter

public AddTreeNodeFilter()
Method Detail

filterTree

public TreeRoot filterTree(TreeRoot tree,
                           RaritanPageContext rpc)
Description copied from interface: ITreeFilter
Filter (prune, add, modify etc.) a Tree object.

Specified by:
filterTree in interface ITreeFilter

filterNode

public TreeNode filterNode(TreeNode node,
                           TreeRoot sourceTree,
                           RaritanPageContext rpc)
Specified by:
filterNode in interface ITreeFilter

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IConfigurable
Initializes the object from an XML tag or element. This method is called by the Framework as part of the application initializtion. see ConfigurationManager, XMLConfigurationManager, XMLSearchFieldMapFactory, XMLSearchSourceFactory. Configurable objects that are owned or contained by other configurable objects will be initialized in by the parent object.

Specified by:
initialize in interface IConfigurable

getConfigurationXML

public void getConfigurationXML(java.io.Writer writer)
                         throws java.io.IOException
Throws:
java.io.IOException

getConfigurationXML

public java.lang.String getConfigurationXML()

getConfigurationXML

public java.lang.String getConfigurationXML(java.lang.String configurationTemplate)