org.apache.axiom.om.impl.traverse
Class OMChildrenQNameIterator

java.lang.Object
  extended by org.apache.axiom.om.impl.traverse.OMChildrenIterator
      extended by org.apache.axiom.om.impl.traverse.OMChildrenQNameIterator
All Implemented Interfaces:
java.util.Iterator
Direct Known Subclasses:
OMChildrenLegacyQNameIterator, OMChildrenLocalNameIterator, OMChildrenNamespaceIterator

public class OMChildrenQNameIterator
extends OMChildrenIterator

Class OMChildrenQNameIterator This iterator returns the elements that have a matching QName. This class can be extended to customize the QName equality.


Field Summary
private  javax.xml.namespace.QName givenQName
          Field givenQName
private  boolean isMatchingNodeFound
          Field isMatchingNodeFound
private  boolean needToMoveForward
          Field needToMoveForward
 
Fields inherited from class org.apache.axiom.om.impl.traverse.OMChildrenIterator
currentChild, isExceptionThrownInAdvancingToNextElement, lastChild, nextCalled, removeCalled
 
Constructor Summary
OMChildrenQNameIterator(OMNode currentChild, javax.xml.namespace.QName givenQName)
          Constructor OMChildrenQNameIterator.
 
Method Summary
private  void findNextElementWithQName()
           
 boolean hasNext()
          Returns true if the iteration has more elements.
 boolean isEqual(javax.xml.namespace.QName searchQName, javax.xml.namespace.QName currentQName)
          Returns true if the qnames are equal.
static boolean isEquals_Legacy(javax.xml.namespace.QName searchQName, javax.xml.namespace.QName currentQName)
          Deprecated.  
 java.lang.Object next()
          Returns the next element in the iteration.
 
Methods inherited from class org.apache.axiom.om.impl.traverse.OMChildrenIterator
remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

givenQName

private final javax.xml.namespace.QName givenQName
Field givenQName


needToMoveForward

private boolean needToMoveForward
Field needToMoveForward


isMatchingNodeFound

private boolean isMatchingNodeFound
Field isMatchingNodeFound

Constructor Detail

OMChildrenQNameIterator

public OMChildrenQNameIterator(OMNode currentChild,
                               javax.xml.namespace.QName givenQName)
Constructor OMChildrenQNameIterator.

Parameters:
currentChild -
givenQName -
Method Detail

isEqual

public boolean isEqual(javax.xml.namespace.QName searchQName,
                       javax.xml.namespace.QName currentQName)
Returns true if the qnames are equal. The default algorithm is to use the QName equality (which examines the namespace and localPart). You can extend this class to provide your own equality algorithm.

Parameters:
searchQName -
currentQName -
Returns:
true if qnames are equal.

hasNext

public boolean hasNext()
Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Specified by:
hasNext in interface java.util.Iterator
Overrides:
hasNext in class OMChildrenIterator
Returns:
Returns true if the iterator has more elements.

findNextElementWithQName

private void findNextElementWithQName()

next

public java.lang.Object next()
Returns the next element in the iteration.

Specified by:
next in interface java.util.Iterator
Overrides:
next in class OMChildrenIterator
Returns:
Returns the next element in the iteration.
Throws:
java.util.NoSuchElementException - iteration has no more elements.

isEquals_Legacy

public static boolean isEquals_Legacy(javax.xml.namespace.QName searchQName,
                                      javax.xml.namespace.QName currentQName)
Deprecated. 

Prior versions of the OMChildrenQNameIterator used the following logic to check equality. This algorithm is incorrect; however some customers have dependency on this behavior. This method is retained (but deprecated) to allow them an opportunity to use the old algorithm.

Parameters:
searchQName -
currentQName -
Returns:
true using legacy equality match