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:
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
 
Fields inherited from class org.apache.axiom.om.impl.traverse.OMChildrenIterator
currentChild, lastChild, nextCalled, removeCalled
 
Constructor Summary
OMChildrenQNameIterator(OMNode currentChild, javax.xml.namespace.QName givenQName)
          Constructor OMChildrenQNameIterator.
 
Method Summary
 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.  
 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
 

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 Iterator
Overrides:
hasNext in class OMChildrenIterator
Returns:
Returns true if the iterator has more elements.

next

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

Specified by:
next in interface Iterator
Overrides:
next in class OMChildrenIterator
Returns:
Returns the next element in the iteration.
Throws:
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


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