public class Trigger extends PatternWatch
| Constructor and Description |
|---|
Trigger(Pattern selection,
Feed action,
XPathContext selectionContext) |
| 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(Location locationId)
Signal that the endElement event has occurred for the element whose startElement
event caused the Watch to be activated.
|
Feed |
getAction()
Get the Feed representing the pipeline of operations performed by this Trigger
|
boolean |
isMatchCurrentGroup()
Ask whether or not the pattern should use all nodes in the current group as
anchor nodes (by default only the first is matched)
|
boolean |
matchesNode(FleetingNode node,
XPathContext context)
Determine whether the watch matches a given node
|
void |
open(Terminator terminator)
Open the watch.
|
void |
processItem(Item item)
Signal that a node (other than an element) that matches the selection
has been found.
|
void |
setMatchCurrentGroup(boolean matchCurrentGroup)
Set whether or not the pattern should use all nodes in the current group as
anchor nodes (by default only the first is matched)
|
void |
setSelection(Pattern selection)
Set the selection (that is, the streamable XPath expression) that defines
the nodes that this Watch is looking for
|
Receiver |
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.
|
getAnchorNode, getSelection, matchesNodesOfKind, setAnchorNodegetNamespaceResolver, getPipelineConfiguration, getReceiver, setNamespaceResolver, setPipelineConfigurationpublic Trigger(Pattern selection, Feed action, XPathContext selectionContext)
public boolean matchesNode(FleetingNode node, XPathContext context) throws XPathException
PatternWatchmatchesNode in interface WatchmatchesNode in class PatternWatchnode - the node to be testedcontext - the XPath dynamic contextXPathException - if a dynamic error occurspublic Feed getAction()
public void open(Terminator terminator) throws XPathException
open in interface Watchopen in class PatternWatchterminator - the callback to be used to signal early exitXPathException - May be raised if a dynamic error occurspublic Receiver startSelectedParentNode(FleetingParentNode node, Location 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 occurspublic void endSelectedParentNode(Location locationId) throws XPathException
locationId - the location of the elementXPathException - May be raised if a constraint implemented by this
Watch is violatedpublic void processItem(Item item) throws XPathException
processItem in interface WatchprocessItem in class PatternWatchitem - the node that was matched.XPathException - May be raised if a dynamic error occurspublic void close()
throws XPathException
close in interface Watchclose in class PatternWatchXPathException - May be raised if a dynamic error occurspublic boolean isMatchCurrentGroup()
public void setSelection(Pattern selection)
setSelection in class PatternWatchselection - the streamable XPath expressionpublic void setMatchCurrentGroup(boolean matchCurrentGroup)
matchCurrentGroup - true if every node in the current group is to act
as an anchor nodeCopyright (c) 2004-2018 Saxonica Limited. All rights reserved.