com.infomancers.collections.tree
Class DOMAdapter

java.lang.Object
  extended by com.infomancers.collections.tree.DOMAdapter
All Implemented Interfaces:
TreeAdapter

public final class DOMAdapter
extends java.lang.Object
implements TreeAdapter

Adapter wrapping an XML DOM.


Constructor Summary
DOMAdapter(org.w3c.dom.Document document)
           
 
Method Summary
 java.lang.Iterable<java.lang.Object> getChildren(java.lang.Object node)
          Retrieves the children of the node specified.
 java.lang.Object getRoot()
          Retrieves the root of the tree.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DOMAdapter

public DOMAdapter(org.w3c.dom.Document document)
Method Detail

getChildren

public java.lang.Iterable<java.lang.Object> getChildren(java.lang.Object node)
Retrieves the children of the node specified. If the node has no children (is a leaf), an empty iterable is returned.

Cannot return null.

Specified by:
getChildren in interface TreeAdapter
Parameters:
node - The node to retrieve the children for.
Returns:
The children nodes of the node.

getRoot

public java.lang.Object getRoot()
Retrieves the root of the tree.

Cannot return null.

Specified by:
getRoot in interface TreeAdapter
Returns:
The root of the tree.