Package com.saxonica.ee.stream.watch
Class StreamWatch
java.lang.Object
com.saxonica.ee.stream.watch.AbstractWatch
com.saxonica.ee.stream.watch.StreamWatch
- All Implemented Interfaces:
Watch
-
Constructor Summary
ConstructorsConstructorDescriptionStreamWatch
(Inversion action, WatchManager watchManager, XPathContext context) -
Method Summary
Modifier and TypeMethodDescriptionvoid
endSelectedParentNode
(Location locationId) Signal that the endElement event has occurred for the element whose startElement event caused the Watch to be activated.Get the anchor node for the watch.boolean
matchesNode
(FleetingNode node, XPathContext context) Determine whether the watch matches a given nodeboolean
matchesNodesOfKind
(UType kind) Ask whether the Watch is capable of matching nodes of a particular kindvoid
setAnchorNode
(FleetingParentNode anchor) Set the anchor node for the watch.startSelectedParentNode
(FleetingParentNode node, Location locationId) Signal that an element or document node has been found that matches the selection that this Watch is looking for.Methods inherited from class com.saxonica.ee.stream.watch.AbstractWatch
close, getNamespaceResolver, getPipelineConfiguration, open, processItem, setNamespaceResolver, setPipelineConfiguration
-
Constructor Details
-
StreamWatch
-
-
Method Details
-
matchesNode
Determine whether the watch matches a given node- Parameters:
node
- the node to be testedcontext
- the XPath dynamic context- Returns:
- true if the node is one of those the Watch is looking out for
- Throws:
XPathException
- if a dynamic error occurs
-
matchesNodesOfKind
Ask whether the Watch is capable of matching nodes of a particular kind- Parameters:
kind
- the node kind- Returns:
- true if the watch is capabl of matching
-
setAnchorNode
Set the anchor node for the watch. This is the node to which the watch is scoped, typically the context node for the streamable path expression that defines the root of the subtree within which nodes are being sought.- Parameters:
anchor
- The anchor node within which the watch is scoped
-
getAnchorNode
Get the anchor node for the watch. This is the node to which the watch is scoped, typically the context node for the streamable path expression that defines the root of the subtree within which nodes are being sought.- Returns:
- The anchor node within which the watch is scoped
-
startSelectedParentNode
public Receiver startSelectedParentNode(FleetingParentNode node, Location locationId) throws XPathException Signal that an element or document node has been found that matches the selection that this Watch is looking for. This method is called by the WatchManager while processing the startElement or startDocument event that matches the selection.- Parameters:
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)- Returns:
- a Receiver to be notified of all events starting with the startElement/startDocument event for the matched element, and ending with the endElement event for that element; or null if this feature is not required.
- Throws:
XPathException
- May be raised if a dynamic error occurs
-
endSelectedParentNode
Signal that the endElement event has occurred for the element whose startElement event caused the Watch to be activated.- Parameters:
locationId
- the location of the element- Throws:
XPathException
- May be raised if a constraint implemented by this Watch is violated
-