com.saxonica.validate
Class FieldChecker

java.lang.Object
  extended by com.saxonica.validate.Checker
      extended by com.saxonica.validate.FieldChecker
All Implemented Interfaces:
Result, Receiver

public class FieldChecker
extends Checker

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.


Field Summary
 
Fields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING
 
Constructor Summary
FieldChecker(SelectorWatch parentWatch, Selection selection, Value[] currentRow, int column)
          Create a new FieldWatch
 
Method Summary
 void attribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties)
          Notify an attribute.
 void characters(CharSequence chars, int 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 setNamespaceResolver(NamespaceResolver resolver)
          Set a NamespaceResolver for use by the FieldChecker
 void startElement(int nameCode, int typeCode, int locationId, int properties)
          Notify the start of an element
 
Methods inherited from class com.saxonica.validate.Checker
comment, endDocument, getConfiguration, getPipelineConfiguration, getSystemId, namespace, open, processingInstruction, setPipelineConfiguration, setSystemId, setUnparsedEntity, startContent, startDocument
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldChecker

public FieldChecker(SelectorWatch parentWatch,
                    Selection selection,
                    Value[] currentRow,
                    int column)
Create a new FieldWatch

Parameters:
parentWatch - The SelectorWatch to which field values should be notified
selection - The selection (that is, the restricted XPath expression) used in this field of the constraint
currentRow - represents the selected node whose fields are being evaluated
column - 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(int nameCode,
                         int typeCode,
                         int locationId,
                         int properties)
                  throws XPathException
Notify the start of an element

Specified by:
startElement in interface Receiver
Overrides:
startElement in class Checker
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.
locationId - 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 properties of the element node. If there are no revelant
Throws:
XPathException

attribute

public void attribute(int nameCode,
                      int typeCode,
                      CharSequence value,
                      int locationId,
                      int properties)
               throws XPathException
Notify an attribute. Attributes are notified after the startElement event, and before any children. Namespaces and attributes may be intermingled.

Specified by:
attribute in interface Receiver
Overrides:
attribute in class Checker
Parameters:
nameCode - The name of the attribute, as held in the name pool
typeCode - The type of the attribute, as held in the name pool
locationId - 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:
DISABLE_ESCAPING
Disable escaping for this attribute
NO_SPECIAL_CHARACTERS
Attribute value contains no special characters
value - the string value of the attribute
Throws:
IllegalStateException: - attempt to output an attribute when there is no open element start tag
XPathException

characters

public void characters(CharSequence chars,
                       int 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 interface Receiver
Overrides:
characters in class Checker
Parameters:
chars - The characters
locationId - 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:
DISABLE_ESCAPING
Disable escaping for this text node
USE_CDATA
Output as a CDATA section
Throws:
XPathException

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 interface Receiver
Overrides:
endElement in class Checker
Throws:
XPathException

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 interface Receiver
Overrides:
close in class Checker


Copyright (C) Michael H. Kay. All rights reserved.