org.apache.axiom.om.impl
Class OMNavigator

java.lang.Object
  extended by org.apache.axiom.om.impl.OMNavigator
Direct Known Subclasses:
DOMNavigator, OMNavigator

public class OMNavigator
extends Object

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


Field Summary
protected  OMSerializable node
          Field node
 
Constructor Summary
OMNavigator()
          Constructor OMNavigator.
OMNavigator(OMSerializable node)
          Constructor OMNavigator.
 
Method Summary
 OMSerializable getNext()
          Get the next information item.
 void init(OMSerializable node)
          Method init.
 boolean isCompleted()
          Returns the completed status.
 boolean isNavigable()
          Returns the navigable status.
 OMNode next()
          Get the next node.
 void setDataSourceIsLeaf(boolean value)
          Indicate if an OMSourcedElement with a OMDataSource should be considered as an interior element node or as a leaf.
 void step()
          This is a very special method.
 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 OMSerializable node
Field node

Constructor Detail

OMNavigator

public OMNavigator()
Constructor OMNavigator.


OMNavigator

public OMNavigator(OMSerializable node)
Constructor OMNavigator.

Parameters:
node -
Method Detail

init

public void init(OMSerializable node)
Method init.

Parameters:
node -

setDataSourceIsLeaf

public void setDataSourceIsLeaf(boolean value)
Indicate if an OMSourcedElement with a OMDataSource should be considered as an interior element node or as a leaf.

Parameters:
value - boolean

getNext

public OMSerializable getNext()
Get the next information item.

Returns:
the next information item in the sequence of preorder traversal. Note however that a container (document or element) is treated slightly differently. Once the container is passed it returns the same item in the next encounter as well.

next

public OMNode next()
Get the next node. This method only exists for compatibility with existing code. It may throw a ClassCastException if an attempt is made to use it on a navigator that was created from an OMDocument.

Returns:
the next node
See Also:
getNext()

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.


Copyright © 2004-2013 The Apache Software Foundation. All Rights Reserved.