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.validate
Interface Watch

All Known Implementing Classes:
  FieldWatch, SelectorWatch, SubtreeCopyWatch

public interface Watch

A Watch represents a class that is interested in looking at nodes passing down a push pipeline, typically for the purpose of evaluating uniqueness and key constraints. The nodes that the Watch is interested in are identified by a Selection object.

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 config)` Set the Configuration in use

Method Detail

### getSelection

    public Selection getSelection()

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

  Returns:
    the selection

### setPipelineConfiguration

    public void setPipelineConfiguration(PipelineConfiguration config)

  Set the Configuration in use

  Parameters:
    `config` - the Configuration in use

### setNamespaceResolver

    public void setNamespaceResolver(NamespaceResolver resolver)

  Set a NamespaceResolver for use by the 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

  Parameters:
    `depth` - The depth at which the watch is scoped

### 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

  Returns:
    The depth at which the watch is scoped

### 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

  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

### 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.

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

### 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.

  Throws:
    `XPathException`

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