|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.saxonica.stream.SubtreeCopyWatch
public class SubtreeCopyWatch
This class is used when optimizing a SequentialCopy, that is, when evaluating a construct of the form saxon:stream(doc('a.xml')/a/b/c). When the matched element (c in this example) is encountered, this Watch detects the fact, and activates a Receiver to receive subsequent events and construct a tree being a copy of the subtree rooted at c. On completion, this tree is written to the supplied SequenceWriter. This will often be a Conduit, where hopefully an iterator is waiting for it on another thread.
Constructor Summary | |
---|---|
SubtreeCopyWatch(Selection selection,
PipelineConfiguration pipe,
SequenceWriter pusher)
Create a SubtreeCopyWatch |
Method Summary | |
---|---|
Receiver |
activate(int locationId,
int matchKind)
Signal that an element has been found that matches the selection that this Watch is looking for. |
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 |
deactivate(int locationId)
Signal that the endElement event has occurred for the element whose startElement event caused the Watch to be activated. |
int |
getOriginDepth()
Get the depth within the XML hierarchy of the element whose element declaration contains the unique/key/keyref constraint that this Watch implements |
Selection |
getSelection()
Get the selection (that is, the restricted XPath expression) that defines the nodes that this Watch is looking for |
void |
setNamespaceResolver(NamespaceResolver resolver)
Set a NamespaceResolver for use by the Watch |
void |
setOriginDepth(int depth)
Set the depth within the XML hierarchy of the element whose element declaration contains the unique/key/keyref constraint that this Watch implements |
void |
setPipelineConfiguration(PipelineConfiguration pipe)
Set the PipelineConfiguration in use |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SubtreeCopyWatch(Selection selection, PipelineConfiguration pipe, SequenceWriter pusher)
selection
- the expression defining the nodes to be copiedpipe
- the pipeline configuration informationpusher
- the destination of events for the selected nodesMethod Detail |
---|
public Receiver activate(int locationId, int matchKind) throws ValidationException
activate
in interface Watch
locationId
- the location of the elementmatchKind
- indicates whether the match was on an element in its own right, or as
parent of a matched attribute, or both
ValidationException
- May be raised if the constraint implemented by this
Watch is violated @param locationIdpublic void close() throws XPathException
close
in interface Watch
XPathException
public void deactivate(int locationId) throws XPathException
deactivate
in interface Watch
locationId
- the location of the element
ValidationException
- May be raised if the constraint implemented by this
Watch is violated @param locationId
XPathException
public int getOriginDepth()
getOriginDepth
in interface Watch
public Selection getSelection()
getSelection
in interface Watch
public void setPipelineConfiguration(PipelineConfiguration pipe)
setPipelineConfiguration
in interface Watch
pipe
- the PipelineConfiguration in usepublic void setNamespaceResolver(NamespaceResolver resolver)
setNamespaceResolver
in interface Watch
resolver
- the namespace resolver to be usedpublic void setOriginDepth(int depth)
setOriginDepth
in interface Watch
depth
- The depth at which the watch is scoped
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |