|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.event.SequenceReceiver net.sf.saxon.event.ProxyReceiver com.saxonica.validate.ValidatingFilter com.saxonica.validate.ValidationStack
public class ValidationStack
This class manages the receivers that do element content validation. It maintains a stack of Validators, each of which does local element validation of the contents of a single element, adding a new validator to the stack to handle each layer of nesting.
Field Summary |
---|
Fields inherited from class net.sf.saxon.event.ProxyReceiver |
---|
nextReceiver |
Fields inherited from class net.sf.saxon.event.SequenceReceiver |
---|
pipelineConfiguration, previousAtomic, systemId |
Fields inherited from interface javax.xml.transform.Result |
---|
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING |
Constructor Summary | |
---|---|
ValidationStack(Receiver next,
int initialValidationMode,
SchemaType initialType)
Create a validation stack |
Method Summary | |
---|---|
void |
attribute(NodeName nameCode,
SimpleType typeCode,
CharSequence value,
int locationId,
int properties)
Handle an attribute |
void |
characters(CharSequence chars,
int locationId,
int properties)
Character data |
void |
endDocument()
Notify the end of a document node |
void |
endElement()
End of element |
Map<SchemaComponent,Integer> |
getCoverageStatistics()
Get the statistics showing the usage of individual schema components during a validation episode |
int |
getTopLevelElement()
Get the name of the required top-level element (if any) as a namepool fingerprint |
void |
setConstraintChecker(ConstraintChecker checker)
Set the constraint checker in use (if any). |
void |
setInitialValidator(ContentValidator validator)
Set the initial validator to be used for the outermost element |
void |
setIsNilled(boolean nilled)
Indicate whether the current element is nilled |
void |
setKeepStatistics(boolean keep)
Ask that statistics be maintained for the duration of the validation episode. |
void |
setPipelineConfiguration(PipelineConfiguration pipe)
Set the pipeline configuration |
void |
setStartTagBuffer(StartTagBufferEE resolver)
|
void |
setTopLevelElement(int nameCode)
Set the name of the required top-level element (if any) as a namepool code |
void |
setUnparsedEntity(String name,
String uri,
String publicId)
Set the URI for an unparsed entity in the document. |
void |
setXSIType(SchemaType type)
Set the value of xsi:type, if present. |
void |
setXsiValidationErrors(List errors)
Supply a list of errors found in attributes in the XSI namespace. |
void |
startContent()
Notify the start of the content, that is, the completion of all attributes and namespaces. |
void |
startElement(NodeName elemName,
SchemaType typeCode,
int locationId,
int properties)
Process element start tag |
void |
testAssertions(NodeInfo root,
UserComplexType type)
Test whether all the assertions on a given complex type are true |
Methods inherited from class com.saxonica.validate.ValidatingFilter |
---|
append, getErrorCode, getInvalidity, isInvalid, reportIfInvalid, reportValidationError, setErrorCode, setInvalidity, usesTypeAnnotations |
Methods inherited from class net.sf.saxon.event.ProxyReceiver |
---|
close, comment, getNamePool, getUnderlyingReceiver, namespace, open, processingInstruction, setSystemId, setUnderlyingReceiver, startDocument |
Methods inherited from class net.sf.saxon.event.SequenceReceiver |
---|
append, getConfiguration, getPipelineConfiguration, getSystemId |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ValidationStack(Receiver next, int initialValidationMode, SchemaType initialType)
next
- the destination of events after passing through validationinitialValidationMode
- the initial validation mode, strict/laxinitialType
- the initial type to validate against, if anyMethod Detail |
---|
public void setPipelineConfiguration(PipelineConfiguration pipe)
Receiver
setPipelineConfiguration
in interface Receiver
setPipelineConfiguration
in class ProxyReceiver
pipe
- the pipeline configurationpublic void setTopLevelElement(int nameCode)
nameCode
- the name of the element that must appear at the root of the subtree
being validatedpublic int getTopLevelElement()
public void setConstraintChecker(ConstraintChecker checker)
checker
- the constraint checkerpublic void setUnparsedEntity(String name, String uri, String publicId) throws XPathException
setUnparsedEntity
in interface Receiver
setUnparsedEntity
in class ProxyReceiver
name
- The name of the unparsed entityuri
- The system identifier of the unparsed entitypublicId
- The public identifier of the unparsed entity
XPathException
- if an error occurspublic void setXSIType(SchemaType type)
type
- the type referenced by the xsi:type attributepublic void setIsNilled(boolean nilled)
nilled
- true if xsi:nil is setpublic void setStartTagBuffer(StartTagBufferEE resolver)
public void setXsiValidationErrors(List errors)
public void startElement(NodeName elemName, SchemaType typeCode, int locationId, int properties) throws XPathException
startElement
in interface Receiver
startElement
in class ProxyReceiver
elemName
- integer code identifying the name of the element within the name pool.typeCode
- integer code identifying the element's type within the name pool.locationId
- an integer which can be interpreted using a LocationProvider
to return
information such as line number and system ID. If no location information is available,
the value zero is supplied.properties
- properties of the element node
XPathException
- if an error occurspublic void setInitialValidator(ContentValidator validator)
validator
- the validator to be used for the outermost element being validatedpublic void attribute(NodeName nameCode, SimpleType typeCode, CharSequence value, int locationId, int properties) throws XPathException
attribute
in interface Receiver
attribute
in class ProxyReceiver
nameCode
- integer identifying the name of the attributetypeCode
- integer identifying the pre-validation type annotation (typically untypedAtomic)value
- the value of the attributeproperties
- additional properties of the attributelocationId
- an integer which can be interpreted using a LocationProvider
to return
information such as line number and system ID. If no location information is available,
the value zero is supplied.
XPathException
- On any failure to write the attributepublic final void startContent() throws XPathException
startContent
in interface Receiver
startContent
in class ProxyReceiver
XPathException
- if an error occurspublic void characters(CharSequence chars, int locationId, int properties) throws XPathException
ProxyReceiver
characters
in interface Receiver
characters
in class ProxyReceiver
chars
- The characterslocationId
- an integer which can be interpreted using a LocationProvider
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:
XPathException
- if an error occurspublic void endElement() throws XPathException
endElement
in interface Receiver
endElement
in class ProxyReceiver
XPathException
- if an error occurspublic void endDocument() throws XPathException
endDocument
in interface Receiver
endDocument
in class ProxyReceiver
XPathException
- if an error occurspublic void testAssertions(NodeInfo root, UserComplexType type) throws XPathException
root
- the element whose assertions are to be testedtype
- the type on which the assertions are defined
ValidationException
- if any of the assertions are not true
XPathException
public void setKeepStatistics(boolean keep)
keep
- true if statistics are to be kept, false if notpublic Map<SchemaComponent,Integer> getCoverageStatistics()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |