
com.saxonica.validate
Class AttributeValidator
java.lang.Object
|
+--net.sf.saxon.event.ProxyReceiver
|
+--com.saxonica.validate.Validator
|
+--com.saxonica.validate.AttributeValidator
- All Implemented Interfaces:
- Receiver, javax.xml.transform.Result, javax.xml.transform.SourceLocator
- Direct Known Subclasses:
- AllElementValidator, ComplexContentValidator, EmptyContentValidator, SimpleContentValidator
- public abstract class AttributeValidator
- extends Validator
- implements Receiver
This class is an abstract superclass for all the receivers that do element content
validation. Since all kinds of element content can be associated with attributes,
the attribute validation is handled at this level.
|
Field Summary |
protected boolean |
nil
|
| Fields inherited from interface javax.xml.transform.Result |
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING |
|
Method Summary |
void |
attribute(int nameCode,
int typeCode,
java.lang.CharSequence value,
int properties)
Handle an attribute |
void |
characters(java.lang.CharSequence chars,
int properties)
Handle character data appearing as a child of the element being validated |
boolean |
isNil()
|
void |
setAttributeGroup(AttributeGroup attributeGroup)
Identify the set of attributes permitted by the complex type being validated. |
void |
startContent()
Notify the start of the content, that is, the completion of all attributes and namespaces. |
void |
startElement(int nameCode,
int typeCode,
int properties)
Handle the start tag for a child element of the element being validated |
| Methods inherited from class com.saxonica.validate.Validator |
checkDerivation, getAnnotation, getChildValidator, getColumnNumber, getContainingElement, getContainingElementName, getElementDeclaration, getLineNumber, getNamespaceResolver, getPublicId, getSystemId, getTypeAnnotation, isNillable, makeValidator, makeValidator, makeValidator, setAnnotation, setContainingElement, setDocumentLocator, setElementDeclaration, setNamespaceResolver, setNillable, setXSIType |
| Methods inherited from class net.sf.saxon.event.ProxyReceiver |
comment, endDocument, endElement, getConfiguration, getNamePool, getUnderlyingReceiver, namespace, processingInstruction, setConfiguration, setSystemId, setUnderlyingReceiver, 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 |
comment, endDocument, endElement, getConfiguration, namespace, processingInstruction, setConfiguration, setDocumentLocator, setSystemId, setUnparsedEntity, startDocument |
| Methods inherited from interface javax.xml.transform.Result |
getSystemId |
nil
protected boolean nil
AttributeValidator
public AttributeValidator()
isNil
public boolean isNil()
setAttributeGroup
public void setAttributeGroup(AttributeGroup attributeGroup)
- Identify the set of attributes permitted by the complex type being validated. This is called
during initialization of the AttributeValidator. It is not called if the type is a simple type;
in such cases any attribute is an error, except for the xsi: attributes permitted on all elements.
- Parameters:
attributeGroup - the set of attributes declared for this complex type
attribute
public void attribute(int nameCode,
int typeCode,
java.lang.CharSequence value,
int properties)
throws javax.xml.transform.TransformerException
- Handle an attribute
- Specified by:
attribute in interface Receiver- Overrides:
attribute in class ProxyReceiver
- Parameters:
nameCode - integer identifying the name of the attributetypeCode - integer identifying the type annotation (ignored)value - the value of the attributeproperties - additional properties of the attribute
- Throws:
javax.xml.transform.TransformerException - On any failure to write the attribute
startElement
public void startElement(int nameCode,
int typeCode,
int properties)
throws javax.xml.transform.TransformerException
- Handle the start tag for a child element of the element being validated
- Specified by:
startElement in interface Receiver- Overrides:
startElement in class Validator
- 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.
javax.xml.transform.TransformerException
characters
public void characters(java.lang.CharSequence chars,
int properties)
throws javax.xml.transform.TransformerException
- Handle character data appearing as a child of the element being validated
- Specified by:
characters in interface Receiver- Overrides:
characters in class ProxyReceiver
- Parameters:
chars - The character contentproperties - Additional properties
- Throws:
javax.xml.transform.TransformerException - If this element does not allow character data
startContent
public final void startContent()
throws javax.xml.transform.TransformerException
- Notify the start of the content, that is, the completion of all attributes and namespaces.
The ValidationStack class is responsible for detecting this event and calling this method.
Note that this event is reported for every element even if it has
no attributes, no namespaces, and no content.
- Specified by:
startContent in interface Receiver- Overrides:
startContent in class ProxyReceiver
javax.xml.transform.TransformerException
Stylus Studio features integrated development and debugging support for Saxon in the XQuery editor and XSLT editor.