net.sf.saxon.evpull
Class Decomposer

java.lang.Object
  extended by net.sf.saxon.evpull.Decomposer
All Implemented Interfaces:
EventIterator, PullEvent

public class Decomposer
extends Object
implements EventIterator

This class takes a sequence of pull events and turns it into fully-decomposed form, that is, it takes and document and element nodes in the sequence and turns them into a subsequence consisting of a start element|document event, a content sequence, and an end element|document event, recursively.

The resulting sequence is decomposed, but not flat (it will contain nested EventIterators). To flatten it, use EventStackIterator.flatten(EventIterator)


Constructor Summary
Decomposer(EventIterator base, PipelineConfiguration pipe)
          Create a Decomposer, which turns an event sequence into fully decomposed form
Decomposer(NodeInfo node, PipelineConfiguration pipe)
          Create a Decomposer which returns the sequence of events corresponding to a particular node
 
Method Summary
 boolean isFlatSequence()
          Determine whether the EventIterator returns a flat sequence of events, or whether it can return nested event iterators
 PullEvent next()
          Get the next event in the sequence
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Decomposer

public Decomposer(EventIterator base,
                  PipelineConfiguration pipe)
Create a Decomposer, which turns an event sequence into fully decomposed form

Parameters:
base - the base sequence, which may be fully composed, fully decomposed, or anything in between
pipe - the Saxon pipeline configuration

Decomposer

public Decomposer(NodeInfo node,
                  PipelineConfiguration pipe)
Create a Decomposer which returns the sequence of events corresponding to a particular node

Parameters:
node - the node to be decomposed
pipe - the Saxon pipeline configuration
Method Detail

next

public PullEvent next()
               throws XPathException
Get the next event in the sequence

Specified by:
next in interface EventIterator
Returns:
the next event, or null when the sequence is exhausted. Note that since an EventIterator is itself a PullEvent, this method may return a nested iterator.
Throws:
XPathException - if a dynamic evaluation error occurs

isFlatSequence

public boolean isFlatSequence()
Determine whether the EventIterator returns a flat sequence of events, or whether it can return nested event iterators

Specified by:
isFlatSequence in interface EventIterator
Returns:
true if the next() method is guaranteed never to return an EventIterator


Copyright (c) 2004-2010 Saxonica Limited. All rights reserved.