Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.saxonica.extra
Class SubtreeCopyWatch

    java.lang.Object
      com.saxonica.extra.SubtreeCopyWatch

All Implemented Interfaces:
  Watch

public class SubtreeCopyWatch
extends java.lang.Object
implements Watch

This class is used when optimizing a SequentialCopy, that is, when evaluating a construct of the form xsl:copy-of select="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 Conduit, where hopefully an iterator is waiting for it on another thread.

Constructor Summary
`SubtreeCopyWatch(Selection selection, PipelineConfiguration pipe, com.saxonica.extra.Conduit conduit)`

Method Summary
`Receiver` | `activate()` 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()` 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

### SubtreeCopyWatch

    public SubtreeCopyWatch(Selection selection,
                            PipelineConfiguration pipe,
                            com.saxonica.extra.Conduit conduit)
                     throws XPathException

Method Detail

### activate

    public Receiver activate()
                      throws ValidationException

  Signal that an element has been found that matches the selection that this Watch is looking for. This method is called by the ConstraintChecker while processing the startElement event that matches the selection. For this purpose, any attributes selected by the last step in the selection are ignored

  Specified by:
    `activate` in interface `Watch`
  Returns:
    a Receiver to be notified of all events starting with the startElement event for the matched element, and ending with the endElement event for that element.
  Throws:
    `ValidationException` - May be raised if the constraint implemented by this Watch is violated

### close

    public void close()
               throws XPathException

  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.

  Specified by:
    `close` in interface `Watch`
  Throws:
    `XPathException`

### deactivate

    public void deactivate()
                    throws XPathException

  Signal that the endElement event has occurred for the element whose startElement event caused the Watch to be activated.

  Specified by:
    `deactivate` in interface `Watch`
  Throws:
    `ValidationException` - May be raised if the constraint implemented by this Watch is violated
    `XPathException`

### getOriginDepth

    public 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

  Specified by:
    `getOriginDepth` in interface `Watch`
  Returns:
    The depth at which the watch is scoped. -1 indicates the document node

### getSelection

    public Selection getSelection()

  Get the selection (that is, the restricted XPath expression) that defines the nodes that this Watch is looking for

  Specified by:
    `getSelection` in interface `Watch`
  Returns:
    the selection

### setPipelineConfiguration

    public void setPipelineConfiguration(PipelineConfiguration pipe)

  Set the PipelineConfiguration in use

  Specified by:
    `setPipelineConfiguration` in interface `Watch`
  Parameters:
    `pipe` - the PipelineConfiguration in use

### setNamespaceResolver

    public void setNamespaceResolver(NamespaceResolver resolver)

  Set a NamespaceResolver for use by the Watch

  Specified by:
    `setNamespaceResolver` in interface `Watch`

### setOriginDepth

    public 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

  Specified by:
    `setOriginDepth` in interface `Watch`
  Parameters:
    `depth` - The depth at which the watch is scoped

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD