Class NodeExtractor

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<org.w3c.dom.Node>, java.util.Collection<org.w3c.dom.Node>, java.util.Deque<org.w3c.dom.Node>, java.util.List<org.w3c.dom.Node>, java.util.Queue<org.w3c.dom.Node>

    class NodeExtractor
    extends java.util.LinkedList<org.w3c.dom.Node>
    The NodeExtractor object is used to extract nodes from a provided DOM document. This is used so that the nodes of a given document can be read with queue like semantics, such that the first node encountered is the first node taken from the queue. Queue semantics help transform DOM documents to an event stream much like the StAX framework.
    • Field Summary

      • Fields inherited from class java.util.AbstractList

        modCount
    • Constructor Summary

      Constructors 
      Constructor Description
      NodeExtractor​(org.w3c.dom.Document source)
      Constructor for the NodeExtractor object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void extract​(org.w3c.dom.Document source)
      This is used to extract the nodes of the document in such a way that it can be navigated as a queue.
      private void extract​(org.w3c.dom.Node source)
      This is used to extract the nodes of the element in such a way that it can be navigated as a queue.
      • Methods inherited from class java.util.LinkedList

        add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray
      • Methods inherited from class java.util.AbstractSequentialList

        iterator
      • Methods inherited from class java.util.AbstractList

        equals, hashCode, listIterator, removeRange, subList
      • Methods inherited from class java.util.AbstractCollection

        containsAll, isEmpty, removeAll, retainAll, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.util.Deque

        iterator
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
    • Constructor Detail

      • NodeExtractor

        public NodeExtractor​(org.w3c.dom.Document source)
        Constructor for the NodeExtractor object. This is used to instantiate an object that flattens a document in to a queue so that the nodes can be used for streaming.
        Parameters:
        source - this is the source document to be flattened
    • Method Detail

      • extract

        private void extract​(org.w3c.dom.Document source)
        This is used to extract the nodes of the document in such a way that it can be navigated as a queue. In order to do this each node encountered is pushed in to the queue so that when finished the nodes can be dealt with as a stream.
        Parameters:
        source - this is the source document to be flattened
      • extract

        private void extract​(org.w3c.dom.Node source)
        This is used to extract the nodes of the element in such a way that it can be navigated as a queue. In order to do this each node encountered is pushed in to the queue so that when finished the nodes can be dealt with as a stream.
        Parameters:
        source - this is the source element to be flattened