public abstract class SelectorWatch extends AbstractWatch
Constructor and Description |
---|
SelectorWatch(ConstraintChecker checker,
IdentityConstraint uniqueConstraint) |
Modifier and Type | Method and Description |
---|---|
void |
addFieldValue(AtomicSequence[] currentRow,
int column,
AtomicSequence value,
boolean nillableElement,
long locationId)
The addFieldValue method is a callback from the FieldWatch created when this
SelectorWatch is activated.
|
protected void |
checkRow(AtomicSequence[] currentRow,
boolean isTarget,
int 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.
|
protected String |
displayRow(AtomicSequence[] row)
Internal method to display the contents of a row, for diagnostics
|
void |
endSelectedParentNode(int 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,
long locationId)
Report a validation error
|
protected void |
reportValidationError(ValidationException err,
SourceLocator locator)
Report a validation error
|
Receiver |
startSelectedParentNode(FleetingNode node,
int locationId)
Signal that an element has been found that matches the selection that this
Watch is looking for.
|
getAnchorNode, getNamespaceResolver, getPipelineConfiguration, getSelection, notifySelectedLeafNode, open, setAnchorNode, setNamespaceResolver, setPipelineConfiguration, setSelection
public SelectorWatch(ConstraintChecker checker, IdentityConstraint uniqueConstraint)
public IdentityConstraint getIdentityConstraint()
public Receiver startSelectedParentNode(FleetingNode node, int 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(int locationId) throws ValidationException
locationId
- the location of the elementValidationException
- 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 AbstractWatch
ValidationException
public void addFieldValue(AtomicSequence[] currentRow, int column, AtomicSequence value, boolean nillableElement, long 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, int 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 String displayRow(AtomicSequence[] row)
protected void reportValidationError(ValidationException err, long locationId) throws ValidationException
err
- The validation exceptionlocationId
- identifies the location in the source document or stylesheet/query where the
validation error was detectedValidationException
protected void reportValidationError(ValidationException err, SourceLocator 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-2013 Saxonica Limited. All rights reserved.