|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--net.sf.saxon.event.ProxyReceiver
|
+--com.saxonica.validate.Validator
This class is an abstract superclass for all the validators. The class includes factory methods for constructing a validator.
| Field Summary | |
protected SchemaType |
xsiType
|
| Fields inherited from class net.sf.saxon.event.ProxyReceiver |
baseReceiver, config, systemId |
| Fields inherited from interface javax.xml.transform.Result |
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING |
| Constructor Summary | |
Validator()
|
|
| Method Summary | |
static void |
checkDerivation(SchemaType xsiType,
SchemaType type,
int block)
Check that this type is validly derived from a given type |
protected int |
getAnnotation()
Get the type annotation code to be used on elements validated by this validator |
protected abstract Validator |
getChildValidator()
Get a validator to handle the children of the current element. |
int |
getColumnNumber()
Return the character position where the current document event ends. |
int |
getContainingElement()
Get the fingerprint of the name of the element being validated (for diagnostics). |
protected java.lang.String |
getContainingElementName()
Get the containing element name, for use in error messages. |
ElementDecl |
getElementDeclaration()
Get the element declaration that this validator is validating against |
int |
getLineNumber()
Return the line number where the current document event ends. |
NamespaceResolver |
getNamespaceResolver()
Get the namespace resolver |
java.lang.String |
getPublicId()
Return the public identifier for the current document event. |
java.lang.String |
getSystemId()
|
abstract int |
getTypeAnnotation()
Get the type annotation to be used for an element or attribute that conforms to the type being validated against |
boolean |
isNillable()
Determine whether this type permits xsi:nil = true |
static Validator |
makeValidator(int nameCode,
SchemaType xsiType,
int validation,
ValidationContext validationContext,
Configuration config)
Factory method to make a validator for a particular element |
static Validator |
makeValidator(SchemaType schemaType)
Factory method to create a validator for elements of this type |
static Validator |
makeValidator(SchemaType type,
SchemaType xsiType,
ElementDecl decl)
|
protected void |
setAnnotation(int annotation)
Set the type annotation code to be allocated by this validator |
void |
setContainingElement(int fingerprint)
Set the fingerprint identifying the name of the containing element (for diagnostics) |
void |
setDocumentLocator(org.xml.sax.Locator locator)
Set the Document Locator |
void |
setElementDeclaration(ElementDecl decl)
Set the element declaration that this validator is validating against |
void |
setNamespaceResolver(NamespaceResolver resolver)
Set the NamespaceResolver to be used for resolving QName-valued attributes |
void |
setNillable(boolean nillable)
Set whether this type permits xsi:nil = true |
void |
setXSIType(SchemaType xsiType)
Set the value of the xsi:type attribute. |
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 net.sf.saxon.event.ProxyReceiver |
attribute, characters, comment, endDocument, endElement, getConfiguration, getNamePool, getUnderlyingReceiver, namespace, processingInstruction, setConfiguration, setSystemId, setUnderlyingReceiver, setUnparsedEntity, startContent, 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 |
attribute, characters, comment, endDocument, endElement, getConfiguration, namespace, processingInstruction, setConfiguration, setSystemId, setUnparsedEntity, startContent, startDocument |
| Field Detail |
protected SchemaType xsiType
| Constructor Detail |
public Validator()
| Method Detail |
public void setContainingElement(int fingerprint)
fingerprint - public void setElementDeclaration(ElementDecl decl)
public ElementDecl getElementDeclaration()
public int getContainingElement()
protected java.lang.String getContainingElementName()
protected void setAnnotation(int annotation)
protected int getAnnotation()
public void setXSIType(SchemaType xsiType)
public void setNamespaceResolver(NamespaceResolver resolver)
public NamespaceResolver getNamespaceResolver()
public void setNillable(boolean nillable)
public boolean isNillable()
public void startElement(int nameCode,
int typeCode,
int properties)
throws javax.xml.transform.TransformerException
startElement in interface ReceiverstartElement in class ProxyReceivernameCode - 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
public static Validator makeValidator(int nameCode,
SchemaType xsiType,
int validation,
ValidationContext validationContext,
Configuration config)
throws javax.xml.transform.TransformerException
nameCode - the name of the element to be validatedxsiType - the type identified by xsi:type, if specified; otherwise nullvalidation - the validation mode (strict, lax, preserve, strip)validationContext - the validation contextconfig - the configuration
javax.xml.transform.TransformerException
public static Validator makeValidator(SchemaType type,
SchemaType xsiType,
ElementDecl decl)
throws javax.xml.transform.TransformerException
javax.xml.transform.TransformerException
public static void checkDerivation(SchemaType xsiType,
SchemaType type,
int block)
throws ValidationException
ValidationException
public void setDocumentLocator(org.xml.sax.Locator locator)
throws javax.xml.transform.TransformerException
setDocumentLocator in interface ReceiversetDocumentLocator in class ProxyReceiverjavax.xml.transform.TransformerExceptionpublic abstract int getTypeAnnotation()
protected abstract Validator getChildValidator()
public java.lang.String getSystemId()
getSystemId in interface javax.xml.transform.ResultgetSystemId in class ProxyReceiverpublic java.lang.String getPublicId()
The return value is the public identifier of the document entity or of the external parsed entity in which the markup that triggered the event appears.
getPublicId in interface javax.xml.transform.SourceLocatorgetSystemId()public int getLineNumber()
Warning: The return value from the method is intended only as an approximation for the sake of error reporting; it is not intended to provide sufficient information to edit the character content of the original XML document.
The return value is an approximation of the line number in the document entity or external parsed entity where the markup that triggered the event appears.
getLineNumber in interface javax.xml.transform.SourceLocatorgetColumnNumber()public int getColumnNumber()
Warning: The return value from the method is intended only as an approximation for the sake of error reporting; it is not intended to provide sufficient information to edit the character content of the original XML document.
The return value is an approximation of the column number in the document entity or external parsed entity where the markup that triggered the event appears.
getColumnNumber in interface javax.xml.transform.SourceLocatorgetLineNumber()public static Validator makeValidator(SchemaType schemaType)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||