Package com.saxonica.ee.validate
Class FieldChecker
- java.lang.Object
-
- com.saxonica.ee.validate.AbstractReceiver
-
- com.saxonica.ee.validate.FieldChecker
-
- All Implemented Interfaces:
javax.xml.transform.Result
,Receiver
public class FieldChecker extends AbstractReceiver
A FieldChecker is instantiated when a field in an identity constraint is matched; it receives notification of all events until the end of the element (or attribute) that matched the selector.
-
-
Constructor Summary
Constructors Constructor Description FieldChecker(SelectorWatch parentWatch, Pattern selection, AtomicSequence[] currentRow, int column)
Create a new FieldChecker
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(java.lang.CharSequence chars, Location locationId, int properties)
Notify character data.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
endElement()
Notify the end of an element.void
notifySelectedAttribute(FleetingNode attribute, Location locationId)
Notify an attribute that matches the selection.void
setNamespaceResolver(NamespaceResolver resolver)
Set a NamespaceResolver for use by the FieldCheckervoid
startElement(NodeName nameCode, SchemaType typeCode, AttributeMap attributes, NamespaceMap namespaces, Location location, int properties)
Notify the start of an elementboolean
usesTypeAnnotations()
Ask whether this Receiver (or the downstream pipeline) makes any use of the type annotations supplied on element and attribute events-
Methods inherited from class com.saxonica.ee.validate.AbstractReceiver
comment, endDocument, getConfiguration, getPipelineConfiguration, getSystemId, open, processingInstruction, setPipelineConfiguration, setSystemId, setUnparsedEntity, startDocument
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.event.Receiver
append, append, handlesAppend
-
-
-
-
Constructor Detail
-
FieldChecker
public FieldChecker(SelectorWatch parentWatch, Pattern selection, AtomicSequence[] currentRow, int column)
Create a new FieldChecker- Parameters:
parentWatch
- The SelectorWatch to which field values should be notifiedselection
- The selection (that is, the restricted XPath expression) used in this field of the constraintcurrentRow
- represents the selected node whose fields are being evaluatedcolumn
- sequence number for this field within the constraint being evaluated
-
-
Method Detail
-
setNamespaceResolver
public void setNamespaceResolver(NamespaceResolver resolver)
Set a NamespaceResolver for use by the FieldChecker- Parameters:
resolver
- the namespace resolver to be used
-
startElement
public void startElement(NodeName nameCode, SchemaType typeCode, AttributeMap attributes, NamespaceMap namespaces, Location location, int properties) throws XPathException
Notify the start of an element- Specified by:
startElement
in interfaceReceiver
- Overrides:
startElement
in classAbstractReceiver
- Parameters:
nameCode
- integer code identifying the name of the element within the name pool.typeCode
- integer code identifying the element's type within the name pool. The value -1 indicates the default type, xs:untyped.attributes
-location
- location of the start tagproperties
- bit-significant properties of the element node. If there are no relevant properties, zero is supplied. The definitions of the bits are in classReceiverOption
namespaces
- the in-scope namespaces of this element: generally this is all the in-scope namespaces, without relying on inheriting namespaces from parent elements- Throws:
XPathException
- if an error occurs
-
notifySelectedAttribute
public void notifySelectedAttribute(FleetingNode attribute, Location locationId) throws XPathException
Notify an attribute that matches the selection. Attributes are notified after the startElement event, and before any children. Namespaces and attributes may be intermingled.- Parameters:
attribute
- the attribute node being notifiedlocationId
- the location for error reporting purposes- Throws:
XPathException
- if a dynamic error occurs
-
characters
public void characters(java.lang.CharSequence chars, Location locationId, int properties) throws XPathException
Notify character data. Note that some receivers may require the character data to be sent in a single event, but in general this is not a requirement.- Specified by:
characters
in interfaceReceiver
- Overrides:
characters
in classAbstractReceiver
- Parameters:
chars
- The characterslocationId
- an integer which can be interpreted using a LocationMap to return information such as line number and system ID. If no location information is available, the value zero is supplied.properties
- Bit significant value. The following bits are defined:- Throws:
XPathException
- if an error occurs
-
endElement
public void endElement() throws XPathException
Description copied from interface:Receiver
Notify the end of an element. The receiver must maintain a stack if it needs to know which element is ending.- Specified by:
endElement
in interfaceReceiver
- Overrides:
endElement
in classAbstractReceiver
- Throws:
XPathException
- if an error occurs
-
close
public 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.- Specified by:
close
in interfaceReceiver
- Overrides:
close
in classAbstractReceiver
-
usesTypeAnnotations
public boolean usesTypeAnnotations()
Ask whether this Receiver (or the downstream pipeline) makes any use of the type annotations supplied on element and attribute events- Specified by:
usesTypeAnnotations
in interfaceReceiver
- Overrides:
usesTypeAnnotations
in classAbstractReceiver
- Returns:
- true if the Receiver makes any use of this information. If false, the caller may supply untyped nodes instead of supplying the type annotation
-
-