public abstract class SelectorWatch extends PatternWatch
Constructor and Description |
---|
SelectorWatch(ConstraintChecker checker,
IdentityConstraint uniqueConstraint) |
Modifier and Type | Method and Description |
---|---|
void |
addFieldValue(AtomicSequence[] currentRow,
int column,
AtomicSequence value,
boolean nillableElement,
Location locationId)
The addFieldValue method is a callback from the FieldWatch created when this
SelectorWatch is activated.
|
protected void |
checkRow(AtomicSequence[] currentRow,
boolean isTarget,
Location locationId)
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 |
endSelectedParentNode(Location locationId)
Signal that the endElement event has occurred for the element whose startElement
event caused the Watch to be activated.
|
IdentityConstraint |
getIdentityConstraint()
Get the identityConstraint implemented by this SelectorWatch
|
protected void |
reportValidationError(ValidationException err,
Location locator)
Report a validation error
|
Receiver |
startSelectedParentNode(FleetingParentNode node,
Location locationId)
Signal that an element has been found that matches the selection that this
Watch is looking for.
|
getAnchorNode, getSelection, matchesNode, matchesNodesOfKind, open, processItem, setAnchorNode, setSelection
getNamespaceResolver, getPipelineConfiguration, getReceiver, setNamespaceResolver, setPipelineConfiguration
public SelectorWatch(ConstraintChecker checker, IdentityConstraint uniqueConstraint)
public IdentityConstraint getIdentityConstraint()
public Receiver startSelectedParentNode(FleetingParentNode node, Location locationId) throws XPathException
node
- the element or document node whose start event has been matchedlocationId
- the location associated with the element or document node (may be
the location of the instruction that created it)ValidationException
- May be raised if the constraint implemented by this
Watch is violatedXPathException
- May be raised if a dynamic error occurspublic void endSelectedParentNode(Location locationId) throws ValidationException
locationId
- ValidationException
- May be raised if the constraint implemented by this
Watch is violated @param locationIdpublic void close() throws ValidationException
close
in interface Watch
close
in class PatternWatch
ValidationException
public void addFieldValue(AtomicSequence[] currentRow, int column, AtomicSequence value, boolean nillableElement, Location locationId) 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 encounterednillableElement
- True if the field represents a nillable elementlocationId
- the location of the data in the source documentValidationException
- May be raised if the value of the field violates
the constraintprotected void checkRow(AtomicSequence[] currentRow, boolean isTarget, Location locationId) throws ValidationException
currentRow
- the values of the set of fieldsisTarget
- 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.locationId
- identifies the location of the selected nodeValidationException
- is raised if the value of the row (that is,
the combination of fields) violates the constraintprotected void reportValidationError(ValidationException err, Location locator) throws ValidationException
err
- The validation exceptionlocator
- identifies the location in the source document or stylesheet/query where the
validation error was detectedValidationException
- if the threshold on number of errors is exceededCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.