Free Trial - Stylus Studio, The World's Best XML IDE!


com.saxonica.validate
Interface Watch

All Known Implementing Classes:
FieldWatch, SelectorWatch

public interface Watch

A Watch represents a class that is interested in looking at nodes for the purpose of evaluating uniqueness and key constraints.


Method Summary
 void activate(int typeCode, int activationDepth)
          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 definesthis the nodes that this Watch is looking for
 void setConfiguration(Configuration config)
          Set the Configuration in use
 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
 

Method Detail

getSelection

public Selection getSelection()
Get the selection (that is, the restricted XPath expression) that definesthis the nodes that this Watch is looking for

Returns:
the selection

setConfiguration

public void setConfiguration(Configuration config)
Set the Configuration in use

Parameters:
config - the Configuration in use

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 void activate(int typeCode,
                     int activationDepth)
              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

Parameters:
typeCode - The type annotation of the element that matches the selection
activationDepth - The depth in the XML tree at which the activation took place
Throws:
ValidationException - May be raised if the constraint implemented by this Watch is violated

deactivate

public void deactivate()
                throws ValidationException
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

close

public void close()
           throws ValidationException
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.

ValidationException


Stylus Studio features integrated development and debugging support for Saxon in the XQuery editor and XSLT editor.