public class MultiAccumulatorWatch extends PatternWatch
The complicating factor (see bug 4430) is that accumulators may invoke each other, and we do not know this statically. We therefore start the processing of a node/event by marking all accumulators unavailable. We then evaluate the accumulators in essentially random order. If one of them invokes another and finds it unavailable, it is then evaluated by a recursive call (with a check for cycles), and removed from the list of accumulators that are unavailable.
Constructor and Description |
---|
MultiAccumulatorWatch(java.util.Map<Accumulator,AccumulatorWatch> accumulatorMap) |
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.
|
java.util.Map<Accumulator,AccumulatorWatch> |
getAccumulatorMap() |
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 |
setWatchManager(WatchManager watchManager) |
Receiver |
startSelectedParentNode(FleetingParentNode node,
Location locationId)
Signal that an element has been found that matches the selection that this
Watch is looking for.
|
getAnchorNode, getSelection, matchesNode, matchesNodesOfKind, setAnchorNode, setSelection
getNamespaceResolver, getPipelineConfiguration, getReceiver, setNamespaceResolver, setPipelineConfiguration
public MultiAccumulatorWatch(java.util.Map<Accumulator,AccumulatorWatch> accumulatorMap)
public java.util.Map<Accumulator,AccumulatorWatch> getAccumulatorMap()
public void open(Terminator terminator) throws XPathException
PatternWatch
open
in interface Watch
open
in class PatternWatch
XPathException
- May be raised if a dynamic error occurspublic void setWatchManager(WatchManager watchManager)
public 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)ValidationException
- May be raised if the constraint implemented by this
Watch is violated @param locationId the location of the node in the source, or of the instruction that created itXPathException
- May be raised if a dynamic error occurspublic void processItem(Item<?> item) throws XPathException
processItem
in interface Watch
processItem
in class PatternWatch
item
- the node that was matched.XPathException
- May be raised if a dynamic error occurspublic void endSelectedParentNode(Location locationId) throws XPathException
locationId
- the location of the parsing eventValidationException
- May be raised if the constraint implemented by this
Watch is violated @param locationId the location of the node in the source, or of the instruction that created itXPathException
- May be raised if a constraint implemented by this
Watch is violatedpublic void close() throws XPathException
PatternWatch
close
in interface Watch
close
in class PatternWatch
XPathException
- May be raised if a dynamic error occursCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.