|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.saxonica.validate.SelectorWatch
A Watch represents a class that is interested in looking at nodes for the purpose of evaluating uniqueness and key constraints. A SelectorWatch looks for the nodes that match the selector in a unique, key, or keyref constraint. There are two concrete subclasses: one for key/unique, the other for keyref
| Constructor Summary | |
SelectorWatch(ConstraintChecker checker,
IdentityConstraint uniqueConstraint,
int originDepth)
|
|
| 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 |
addFieldValue(Value[] currentRow,
int column,
Value value)
The addFieldValue method is a callback from the FieldWatch created when this SelectorWatch is activated. |
protected void |
checkRow(Value[] currentRow,
boolean isTarget)
Method to check that a row (that is, the collection of fields corresponding to one selected node) is valid. |
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. |
protected java.lang.String |
displayRow(Value[] row)
Internal method to display the contents of a row, for diagnostics |
IdentityConstraint |
getIdentityConstraint()
Get the identityConstraint implemented by this SelectorWatch |
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 |
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 |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SelectorWatch(ConstraintChecker checker,
IdentityConstraint uniqueConstraint,
int originDepth)
| Method Detail |
public IdentityConstraint getIdentityConstraint()
public Selection getSelection()
getSelection in interface Watchpublic void setConfiguration(Configuration config)
setConfiguration in interface Watchconfig - the Configuration in usepublic void setOriginDepth(int depth)
setOriginDepth in interface Watchdepth - The depth at which the watch is scopedpublic int getOriginDepth()
getOriginDepth in interface Watch
public void activate(int typeCode,
int activationDepth)
throws ValidationException
activate in interface WatchtypeCode - The type annotation of the element that matches the selectionactivationDepth - The depth in the XML tree at which the activation took place
ValidationException - May be raised if the constraint implemented by this
Watch is violated
public void deactivate()
throws ValidationException
deactivate in interface WatchValidationException - May be raised if the constraint implemented by this
Watch is violated
public void close()
throws ValidationException
close in interface WatchValidationException
public void addFieldValue(Value[] currentRow,
int column,
Value value)
throws ValidationException
currentRow - identifying the node to which this field value
appliescolumn - identifies which of the fields participating in this constraint
the value relates tovalue - The value of the field that was encountered
ValidationException - May be raised if the value of the field violates
the constraint
protected void checkRow(Value[] currentRow,
boolean isTarget)
throws ValidationException
isTarget - set to true if this is a value of the key referred to
by a key reference, rather than a value for this constraint's own selected
fields.
ValidationException - is raised if the value of the row (that is,
the combination of fields) violates the constraintprotected java.lang.String displayRow(Value[] row)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||