Package com.saxonica.ee.validate
Class RefSelectorWatch
java.lang.Object
com.saxonica.ee.stream.watch.AbstractWatch
com.saxonica.ee.stream.watch.PatternWatch
com.saxonica.ee.validate.SelectorWatch
com.saxonica.ee.validate.RefSelectorWatch
- All Implemented Interfaces:
Watch
This class watches the selector for a keyref constraint
-
Constructor Summary
ConstructorsConstructorDescriptionRefSelectorWatch
(ConstraintChecker checker, KeyRef constraint) Create a watch for values that might satisfy a keyref constraint -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
notifyActualKey
(AtomicSequence[] keyValue, Location locationId) Notify a value selected by this KeyRefMethods inherited from class com.saxonica.ee.validate.SelectorWatch
checkRow, endSelectedParentNode, reportValidationError, startSelectedParentNode
Methods inherited from class com.saxonica.ee.stream.watch.PatternWatch
getAnchorNode, getSelection, matchesNode, matchesNodesOfKind, open, processItem, setAnchorNode, setSelection
Methods inherited from class com.saxonica.ee.stream.watch.AbstractWatch
getNamespaceResolver, getPipelineConfiguration, setNamespaceResolver, setPipelineConfiguration
-
Constructor Details
-
RefSelectorWatch
Create a watch for values that might satisfy a keyref constraint- Parameters:
checker
- the ConstraintChecker that initiated this watchconstraint
- the constraint being checked
-
-
Method Details
-
notifyActualKey
Notify a value selected by this KeyRef- Parameters:
keyValue
- an array holding the components (fields) making up the keyref valuelocationId
- the location of the node containing the keyref values- Throws:
ValidationException
- if the value is invalid for example a duplicateXPathException
-
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. This implementation searches the list of all key values encountered looking (a) for key references that reference no corresponding key value (b) for key references that reference more than one corresponding key value (which can happen if the keyref and the key are defined at different levels of hierarchy.- Specified by:
close
in interfaceWatch
- Overrides:
close
in classSelectorWatch
- Throws:
XPathException
- May be raised if a dynamic error occurs
-