Package net.sf.saxon.evpull
Class Decomposer
java.lang.Object
net.sf.saxon.evpull.Decomposer
- All Implemented Interfaces:
EventIterator
,PullEvent
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
ConstructorsConstructorDescriptionDecomposer
(EventIterator base, PipelineConfiguration pipe) Create a Decomposer, which turns an event sequence into fully decomposed formDecomposer
(NodeInfo node, PipelineConfiguration pipe) Create a Decomposer which returns the sequence of events corresponding to a particular node -
Method Summary
Modifier and TypeMethodDescriptionboolean
Determine whether the EventIterator returns a flat sequence of events, or whether it can return nested event iteratorsnext()
Get the next event in the sequence
-
Constructor Details
-
Decomposer
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 betweenpipe
- the Saxon pipeline configuration
-
Decomposer
Create a Decomposer which returns the sequence of events corresponding to a particular node- Parameters:
node
- the node to be decomposedpipe
- the Saxon pipeline configuration
-
-
Method Details
-
next
Get the next event in the sequence- Specified by:
next
in interfaceEventIterator
- 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 interfaceEventIterator
- Returns:
- true if the next() method is guaranteed never to return an EventIterator
-