sferyx.administration.renderers.parser.xml
Class ElementIterator

java.lang.Object
  extended by sferyx.administration.renderers.parser.xml.ElementIterator
All Implemented Interfaces:
java.lang.Cloneable

public class ElementIterator
extends java.lang.Object
implements java.lang.Cloneable


Constructor Summary
ElementIterator(org.w3c.dom.Document document)
          Creates a new ElementIterator.
ElementIterator(org.w3c.dom.Element root)
          Creates a new ElementIterator.
 
Method Summary
 java.lang.Object clone()
          Clones the ElementIterator.
 org.w3c.dom.Node current()
          Fetches the current Element.
 int depth()
          Fetches the current depth of element tree.
 void dumpNode(org.w3c.dom.Node elem)
           
 void dumpTree()
           
 org.w3c.dom.Element first()
          Fetches the first element.
 org.w3c.dom.Node next()
          Fetches the next Element.
 org.w3c.dom.Node previous()
          Fetches the previous Element.
 void setCallback(Callback callback)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementIterator

public ElementIterator(org.w3c.dom.Document document)
Creates a new ElementIterator. The root element is taken to get the default root element of the document.

Parameters:
document - a Document.

ElementIterator

public ElementIterator(org.w3c.dom.Element root)
Creates a new ElementIterator.

Parameters:
root - the root Element.
Method Detail

clone

public java.lang.Object clone()
Clones the ElementIterator.

Overrides:
clone in class java.lang.Object
Returns:
a cloned ElementIterator Object.

first

public org.w3c.dom.Element first()
Fetches the first element.

Returns:
an Element.

depth

public int depth()
Fetches the current depth of element tree.

Returns:
the depth.

current

public org.w3c.dom.Node current()
Fetches the current Element.

Returns:
element on top of the stack or null if the root element is null

next

public org.w3c.dom.Node next()
Fetches the next Element. The strategy used to locate the next element is a depth-first search.

Returns:
the next element or null at the end of the list.

previous

public org.w3c.dom.Node previous()
Fetches the previous Element. If howver the current element is the last element, or the current element is null, then null is returned.

Returns:
previous Element if available

dumpTree

public void dumpTree()

dumpNode

public void dumpNode(org.w3c.dom.Node elem)

setCallback

public void setCallback(Callback callback)