Class ElementIterator

  • All Implemented Interfaces:
    java.util.Iterator<org.w3c.dom.Element>

    public class ElementIterator
    extends java.lang.Object
    implements java.util.Iterator<org.w3c.dom.Element>
    ElementIterator...
    • Constructor Summary

      Constructors 
      Constructor Description
      ElementIterator​(org.w3c.dom.Element parent)
      Create a new instance of ElementIterator with the given parent element.
      ElementIterator​(org.w3c.dom.Element parent, java.lang.String localName, Namespace namespace)
      Create a new instance of ElementIterator with the given parent element.
      ElementIterator​(org.w3c.dom.Element parent, javax.xml.namespace.QName qname)
      Create a new instance of ElementIterator with the given parent element.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()
      Returns true if there is a next Element
      org.w3c.dom.Element next()  
      org.w3c.dom.Element nextElement()
      Returns the next Element in the iterator.
      void remove()
      Not implemented
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Constructor Detail

      • ElementIterator

        public ElementIterator​(org.w3c.dom.Element parent,
                               java.lang.String localName,
                               Namespace namespace)
        Create a new instance of ElementIterator with the given parent element. Only child elements that match the given local name and namespace will be respected by hasNext() and nextElement().
        Parameters:
        parent -
        localName - local name the child elements must match
        namespace - namespace the child elements must match
      • ElementIterator

        public ElementIterator​(org.w3c.dom.Element parent,
                               javax.xml.namespace.QName qname)
        Create a new instance of ElementIterator with the given parent element. Only child elements that match the given QName will be respected by hasNext() and nextElement().
        Parameters:
        parent -
        qname - name to match (exactly)
      • ElementIterator

        public ElementIterator​(org.w3c.dom.Element parent)
        Create a new instance of ElementIterator with the given parent element. No filtering is applied to child elements that are iterated.
        Parameters:
        parent -
    • Method Detail

      • remove

        public void remove()
        Not implemented
        Specified by:
        remove in interface java.util.Iterator<org.w3c.dom.Element>
        Throws:
        java.lang.UnsupportedOperationException
      • hasNext

        public boolean hasNext()
        Returns true if there is a next Element
        Specified by:
        hasNext in interface java.util.Iterator<org.w3c.dom.Element>
        Returns:
        true if a next Element is available.
      • next

        public org.w3c.dom.Element next()
        Specified by:
        next in interface java.util.Iterator<org.w3c.dom.Element>
        See Also:
        Iterator.next(), nextElement()
      • nextElement

        public org.w3c.dom.Element nextElement()
        Returns the next Element in the iterator.
        Returns:
        the next element
        Throws:
        java.util.NoSuchElementException - if there is no next element.