public interface Feed
A "composed feed" consists entirely of items, supplied using the processItem interface. A "decomposed feed" represents a tree using a sequence of startElement/endElement events. In general the code for a particular expression should be prepared to accept either. However, in many cases (especially expressions that atomize their operand), it is known that the input will always be composed, as a result of the action of an earlier step in the pipeline.
A Feed musy be serially reusable; that is, its state after exiting the close() method must be the same as the state before entering the open() method.
Modifier and Type | Method and Description |
---|---|
void |
close()
The close() method is called immediately before the Watch is destroyed, that is,
when the element whose declaration scopes the constraint implemented by this
Watch goes out of scope.
|
void |
endSelectedParentNode(int locationId)
Signal that the endElement event has occurred for the element whose startElement
event caused the Watch to be activated.
|
PipelineConfiguration |
getPipelineConfiguration()
Get the pipeline configuration
|
SequenceReceiver |
getReceiver()
Get a receiver to which start and end events for documents and elements can be
written.
|
void |
open(Terminator terminator)
Open the feed.
|
void |
processItem(Item item)
Signal that a node (other than a document or element node) that matches the selection
has been found, or that a grounded item is being passed to the next expression in the
evaluation pipeline.
|
Receiver |
startSelectedParentNode(FleetingParentNode node,
int locationId)
Signal that an element or document node has been found that .
|
PipelineConfiguration getPipelineConfiguration()
void open(Terminator terminator) throws XPathException
terminator
- provides a method for early termination of the streamed processing.
The Feed should call the terminator.terminate() method, and close() the result, if it
has computed its result and requires no more input. After a call on terminate(), the
feed MAY be called to supply further input (which it should ignore), or it may never
be called again. The Feed should leave its state clean to allow serial reuse, via
another call on open().XPathException
- May be raised if a dynamic error occursReceiver startSelectedParentNode(FleetingParentNode node, int locationId) throws XPathException
node
- the element or document node whose start event has been matchedlocationId
- the location associated with the element or document node (may be
the location of the instruction that created it)XPathException
- May be raised if a dynamic error occursvoid endSelectedParentNode(int locationId) throws XPathException
locationId
- the location of the elementXPathException
- May be raised if a constraint implemented by this
Watch is violatedvoid processItem(Item item) throws XPathException
item
- the node that was matched.XPathException
- May be raised if a dynamic error occursvoid close() throws XPathException
XPathException
- May be raised if a dynamic error occursSequenceReceiver getReceiver()
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.