com.ibm.xml.policy.xacl
Class HierarchyImpl

java.lang.Object
  |
  +--com.ibm.xml.policy.xacl.HierarchyImpl
All Implemented Interfaces:
Hierarchy

public class HierarchyImpl
extends java.lang.Object
implements Hierarchy

This is an implementation of Hierarchy. You can create an object from an XML document describing an hierarchical data structure, which can be used to describe both gropu and role hierarchies. Here is an example of group hierarchy.

 <node-definition name="all">
   <short-description>
   The root node (including all)
   </short-description>
   <child-nodes>
     <node-definition name="personnel">
       <short-description>
         Personnel
       </short-description>
       <child-nodes>
         <node-definition name="research">
           <short-description>
             Research
           </short-description>
         </node-definition>
         <node-definition name="developement">
           <short-description>
             Developement
           </short-description>
         </node-definition>
       </child-nodes>
     </node-definition>
     <node-definition name="non-personnel">
       <short-description>
         Non-personnel
       </short-description>
     </node-definition>
   </child-nodes>
 </node-definition>
 

Author:
Satoshi Hada, IBM TRL

Constructor Summary
HierarchyImpl(org.w3c.dom.Document doc)
          Constructor.
 
Method Summary
 boolean isAncestorOrEqual(java.lang.String ancestor_node, java.lang.String node)
          Check whether a node is an ancestor of another node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HierarchyImpl

public HierarchyImpl(org.w3c.dom.Document doc)
Constructor.
Parameters:
doc - an XML document descibing a hierarchical data structure.
Method Detail

isAncestorOrEqual

public boolean isAncestorOrEqual(java.lang.String ancestor_node,
                                 java.lang.String node)
Check whether a node is an ancestor of another node.
Specified by:
isAncestorOrEqual in interface Hierarchy
Parameters:
ancestor_node -  
node -  
Returns:
true if the ancestor_node is an ancestor of the node.