Class NodeExtractor

All Implemented Interfaces:
Serializable, Cloneable, Iterable<Node>, Collection<Node>, Deque<Node>, List<Node>, Queue<Node>, SequencedCollection<Node>

class NodeExtractor extends LinkedList<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.
  • Constructor Details

    • NodeExtractor

      public NodeExtractor(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 Details

    • extract

      private void extract(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(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