org.apache.axiom.om.impl.llom
Class OMNavigator

java.lang.Object
  extended by org.apache.axiom.om.impl.llom.OMNavigator

public class OMNavigator
extends java.lang.Object

Refer to the test, org.apache.axiom.om.OMNavigatorTest, to find out how to use features like isNavigable, isComplete and step.


Field Summary
private  boolean backtracked
          Field backtracked
private  boolean end
          Field end
private  org.apache.axiom.om.OMNode next
          Field next
protected  org.apache.axiom.om.OMNode node
          Field node
private  org.apache.axiom.om.OMNode root
          Field root
private  boolean start
          Field start
private  boolean visited
          Field visited
 
Constructor Summary
OMNavigator()
          Constructor OMNavigator.
OMNavigator(org.apache.axiom.om.OMNode node)
          Constructor OMNavigator.
 
Method Summary
private  org.apache.axiom.om.OMNode _getFirstChild(org.apache.axiom.om.OMElement node)
           
private  org.apache.axiom.om.OMNode getNextSibling(org.apache.axiom.om.OMNode node)
           
 void init(org.apache.axiom.om.OMNode node)
          Method init.
 boolean isCompleted()
          Returns the completed status.
 boolean isNavigable()
          Returns the navigable status.
 org.apache.axiom.om.OMNode next()
          Gets the next node.
 void step()
          This is a very special method.
private  void updateNextNode()
          Private method to encapsulate the searching logic.
 boolean visited()
          Method visited.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

node

protected org.apache.axiom.om.OMNode node
Field node


visited

private boolean visited
Field visited


next

private org.apache.axiom.om.OMNode next
Field next


root

private org.apache.axiom.om.OMNode root
Field root


backtracked

private boolean backtracked
Field backtracked


end

private boolean end
Field end


start

private boolean start
Field start

Constructor Detail

OMNavigator

public OMNavigator()
Constructor OMNavigator.


OMNavigator

public OMNavigator(org.apache.axiom.om.OMNode node)
Constructor OMNavigator.

Parameters:
node -
Method Detail

init

public void init(org.apache.axiom.om.OMNode node)
Method init.

Parameters:
node -

next

public org.apache.axiom.om.OMNode next()
Gets the next node.

Returns:
Returns OMnode in the sequence of preorder traversal. Note however that an element node is treated slightly differently. Once the element is passed it returns the same element in the next encounter as well.

updateNextNode

private void updateNextNode()
Private method to encapsulate the searching logic.


_getFirstChild

private org.apache.axiom.om.OMNode _getFirstChild(org.apache.axiom.om.OMElement node)
Parameters:
node -
Returns:
first child or null

getNextSibling

private org.apache.axiom.om.OMNode getNextSibling(org.apache.axiom.om.OMNode node)
Parameters:
node -
Returns:
next sibling or null

visited

public boolean visited()
Method visited.

Returns:
Returns boolean.

step

public void step()
This is a very special method. This allows the navigator to step once it has reached the existing OM. At this point the isNavigable method will return false but the isComplete method may return false which means that the navigating the given element is not complete and the navigator cannot proceed.


isNavigable

public boolean isNavigable()
Returns the navigable status.

Returns:
Returns boolean.

isCompleted

public boolean isCompleted()
Returns the completed status.

Returns:
Returns boolean.