public abstract class PatternWatch extends AbstractWatch
Constructor and Description |
---|
PatternWatch() |
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.
|
FleetingParentNode |
getAnchorNode()
Get the anchor node for the watch.
|
Pattern |
getSelection()
Get the selection (that is, the restricted XPath expression) that defines
the nodes that this Watch is looking for
|
boolean |
matchesNode(FleetingNode node,
XPathContext context)
Determine whether the watch matches a given node
|
boolean |
matchesNodesOfKind(int kind)
Ask whether the Watch is capable of matching nodes of a particular kind
|
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 |
setAnchorNode(FleetingParentNode anchor)
Set the anchor node for the watch.
|
void |
setSelection(Pattern selection)
Set the selection (that is, the streamable XPath expression) that defines
the nodes that this Watch is looking for
|
getNamespaceResolver, getPipelineConfiguration, getReceiver, setNamespaceResolver, setPipelineConfiguration
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
endSelectedParentNode, startSelectedParentNode
public boolean matchesNode(FleetingNode node, XPathContext context) throws XPathException
node
- the node to be testedcontext
- the XPath dynamic contextXPathException
- if a dynamic error occurspublic boolean matchesNodesOfKind(int kind)
kind
- the node kindpublic void setSelection(Pattern selection)
selection
- the streamable XPath expressionpublic Pattern getSelection()
public void setAnchorNode(FleetingParentNode anchor)
anchor
- The anchor node within which the watch is scopedpublic final FleetingParentNode getAnchorNode()
public void open(Terminator terminator) throws XPathException
open
in interface Watch
open
in class AbstractWatch
terminator
- XPathException
- May be raised if a dynamic error occurspublic void processItem(Item item) throws XPathException
processItem
in interface Watch
processItem
in class AbstractWatch
item
- the node that was matched.XPathException
- May be raised if a dynamic error occurspublic void close() throws XPathException
close
in interface Watch
close
in class AbstractWatch
XPathException
- May be raised if a dynamic error occursCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.