Package org.apache.axiom.om.impl
Class OMNavigator
- java.lang.Object
-
- org.apache.axiom.om.impl.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
Fields Modifier and Type Field Description protected OMSerializablenodeField node
-
Constructor Summary
Constructors Constructor Description OMNavigator()Constructor OMNavigator.OMNavigator(OMSerializable node)Constructor OMNavigator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OMSerializablegetNext()Get the next information item.voidinit(OMSerializable node)Method init.booleanisCompleted()Returns the completed status.booleanisNavigable()Returns the navigable status.OMNodenext()Get the next node.voidsetDataSourceIsLeaf(boolean value)Indicate if an OMSourcedElement with a OMDataSource should be considered as an interior element node or as a leaf.voidstep()This is a very special method.booleanvisited()Method visited.
-
-
-
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 aClassCastExceptionif an attempt is made to use it on a navigator that was created from anOMDocument.- 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.
-
-