Package com.saxonica.ee.validate
Class ComplexContentValidator
java.lang.Object
net.sf.saxon.event.SequenceReceiver
net.sf.saxon.event.ProxyReceiver
com.saxonica.ee.validate.ValidatingFilter
com.saxonica.ee.validate.ContentValidator
com.saxonica.ee.validate.AttributeValidator
com.saxonica.ee.validate.ComplexContentValidator
This class is a filter that is used to validate the content of an element with a
complex type. As each child element is encountered, it is used to compute a transition
in the finite state machine compiled for the given complex type.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.saxonica.ee.validate.ContentValidator
ContentValidator.Nillability -
Field Summary
Fields inherited from class com.saxonica.ee.validate.ContentValidator
childValidator, nilled, pendingMessagesFields inherited from class net.sf.saxon.event.ProxyReceiver
nextReceiverFields inherited from class net.sf.saxon.event.SequenceReceiver
pipelineConfiguration, previousAtomic, systemIdFields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING -
Constructor Summary
ConstructorsConstructorDescriptionComplexContentValidator(ElementDecl declaration, UserComplexType type, Receiver next) Create a ComplexContentValidator for a given type -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(UnicodeString chars, Location locationId, int properties) Handle character data appearing as a child of the element being validatedvoidValidation at the end of the element being validated.protected ContentValidatorGet a validator to handle the children of the current element.Get the schema type against which we are validating, if anyvoidSet the pipeline configurationvoidsetSchemaType(UserComplexType type) Set the schema type against which this validator is to validate the instance elementvoidstartElement(NodeName elemName, SchemaType elemType, AttributeMap attributes, NamespaceMap namespaces, Location location, int properties) Handle the start tag for a child element of the element being validatedMethods inherited from class com.saxonica.ee.validate.AttributeValidator
getMostRecentAttributeType, processWildcardTerm, setAttributeGroup, validateAttributesMethods inherited from class com.saxonica.ee.validate.ContentValidator
checkNoCharactersWhenNil, checkNoChildrenWhenNil, endDocument, getAnnotation, getContainingElement, getContainingElementLocationId, getContainingElementName, getElementDeclaration, getNamespaceResolver, getNillability, isNilled, makeChildValidator, makeValidator, makeValidatorForType, setAnnotation, setContainingElement, setElementDeclaration, setNillability, setNilledMethods inherited from class com.saxonica.ee.validate.ValidatingFilter
append, getAttributeInheritor, getConstraintChecker, getValidationContext, reportIfInvalid, reportValidationError, setConstraintChecker, setStartTagBuffer, setValidationContext, usesTypeAnnotationsMethods inherited from class net.sf.saxon.event.ProxyReceiver
close, comment, getNamePool, getNextReceiver, open, processingInstruction, setSystemId, setUnderlyingReceiver, setUnparsedEntity, startDocumentMethods inherited from class net.sf.saxon.event.SequenceReceiver
append, decompose, flatten, getConfiguration, getErrorCodeForDecomposingFunctionItems, getPipelineConfiguration, getSystemId, handlesAppend
-
Constructor Details
-
ComplexContentValidator
public ComplexContentValidator(ElementDecl declaration, UserComplexType type, Receiver next) throws MissingComponentException Create a ComplexContentValidator for a given type- Parameters:
declaration- the element declaration, if available, or null otherwise.type- the complex typenext- the next receiver in the pipeline- Throws:
MissingComponentException- if the schema is incomplete or invalid
-
-
Method Details
-
setPipelineConfiguration
Description copied from interface:ReceiverSet the pipeline configuration- Specified by:
setPipelineConfigurationin interfaceReceiver- Overrides:
setPipelineConfigurationin classProxyReceiver- Parameters:
pipe- the pipeline configuration
-
setSchemaType
Set the schema type against which this validator is to validate the instance element- Parameters:
type- the schema type used for validation- Throws:
MissingComponentException- if there is a problem with the schema
-
getSchemaType
Description copied from class:ContentValidatorGet the schema type against which we are validating, if any- Specified by:
getSchemaTypein classContentValidator- Returns:
- the schema type that this validator is validating against, or null
-
startElement
public void startElement(NodeName elemName, SchemaType elemType, AttributeMap attributes, NamespaceMap namespaces, Location location, int properties) throws XPathException Handle the start tag for a child element of the element being validated- Specified by:
startElementin interfaceReceiver- Overrides:
startElementin classAttributeValidator- Parameters:
elemName- the name of the element.elemType- the type annotation of the element.attributes- the attributes of this elementnamespaces- the in-scope namespaces of this element: generally this is all the in-scope namespaces, without relying on inheriting namespaces from parent elementslocation- an object providing information about the module, line, and column where the node originatedproperties- bit-significant properties of the element node. If there are no relevant properties, zero is supplied. The definitions of the bits are in classReceiverOption- Throws:
XPathException- if an error occurs
-
getChildValidator
Get a validator to handle the children of the current element. This is called immediately on return from the startElement call that starts this element.- Specified by:
getChildValidatorin classContentValidator- Returns:
- the validator to be used to handle the children
-
characters
public void characters(UnicodeString chars, Location locationId, int properties) throws XPathException Handle character data appearing as a child of the element being validated- Specified by:
charactersin interfaceReceiver- Overrides:
charactersin classAttributeValidator- Parameters:
chars- The character contentlocationId- the location of the node in the source, or of the instruction that created itproperties- Additional properties @throws XPathException If this element does not allow character data- Throws:
XPathException- if an error occurs
-
endElement
Validation at the end of the element being validated. (Note this is a different element from the one passed to startElement).- Specified by:
endElementin interfaceReceiver- Overrides:
endElementin classProxyReceiver- Throws:
XPathException- if the element is invalid
-