Class RefSelectorWatch

  • All Implemented Interfaces:

    public class RefSelectorWatch
    extends SelectorWatch
    This class watches the selector for a keyref constraint
    • Constructor Detail

      • RefSelectorWatch

        public RefSelectorWatch​(ConstraintChecker checker,
                                KeyRef constraint)
        Create a watch for values that might satisfy a keyref constraint
        checker - the ConstraintChecker that initiated this watch
        constraint - the constraint being checked
    • Method Detail

      • notifyActualKey

        public void notifyActualKey​(AtomicSequence[] keyValue,
                                    Location locationId)
                             throws XPathException
        Notify a value selected by this KeyRef
        keyValue - an array holding the components (fields) making up the keyref value
        locationId - the location of the node containing the keyref values
        ValidationException - if the value is invalid for example a duplicate
      • 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. 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 interface Watch
        close in class SelectorWatch
        XPathException - May be raised if a dynamic error occurs