Package com.saxonica.ee.validate
Class SimpleContentValidator
- 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.SimpleContentValidator
 
 
 
 
 
 
- 
- All Implemented Interfaces:
- javax.xml.transform.Result,- Receiver
 
 public class SimpleContentValidator extends AttributeValidator This class is a filter that is used to validate that an element has simple content conforming to a given simple type. This filter accumulates the character data in a buffer and invokes the validation method of the simple type at the time that endElement() is called. Child elements are rejected as invalid. This validator can handle simple types, or complex types with simple content: the attributes are validated by the superclass, Validator.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from class com.saxonica.ee.validate.ContentValidatorContentValidator.Nillability
 
- 
 - 
Field Summary- 
Fields inherited from class com.saxonica.ee.validate.ContentValidatorchildValidator, nilled, pendingMessages
 - 
Fields inherited from class net.sf.saxon.event.ProxyReceivernextReceiver
 - 
Fields inherited from class net.sf.saxon.event.SequenceReceiverpipelineConfiguration, previousAtomic, systemId
 
- 
 - 
Constructor SummaryConstructors Constructor Description SimpleContentValidator(ElementDecl declaration, SchemaType type, Receiver next)Create a simple content validator
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(UnicodeString chars, Location locationId, int properties)Handle character data appearing as a child of the element being validatedvoidendElement()End of element being validatedprotected ContentValidatorgetChildValidator()Return a validator to handle the children of the element just started.SchemaTypegetSchemaType()Get the schema type against which we are validatingvoidsetSchemaType(SchemaType type)Set the schema type against which this validator is to perform validationvoidstartElement(NodeName elemName, SchemaType type, AttributeMap attributes, NamespaceMap namespaces, Location location, int properties)Output element start tag (for a child of the element being validated)- 
Methods inherited from class com.saxonica.ee.validate.AttributeValidatorgetMostRecentAttributeType, processWildcardTerm, setAttributeGroup, validateAttributes
 - 
Methods inherited from class com.saxonica.ee.validate.ContentValidatorcheckNoCharactersWhenNil, checkNoChildrenWhenNil, endDocument, getAnnotation, getContainingElement, getContainingElementLocationId, getContainingElementName, getElementDeclaration, getNamespaceResolver, getNillability, isNilled, makeChildValidator, makeValidator, makeValidatorForType, setAnnotation, setContainingElement, setElementDeclaration, setNillability, setNilled
 - 
Methods inherited from class com.saxonica.ee.validate.ValidatingFilterappend, getAttributeInheritor, getConstraintChecker, getValidationContext, reportIfInvalid, reportValidationError, setConstraintChecker, setStartTagBuffer, setValidationContext, usesTypeAnnotations
 - 
Methods inherited from class net.sf.saxon.event.ProxyReceiverclose, comment, getNamePool, getNextReceiver, open, processingInstruction, setPipelineConfiguration, setSystemId, setUnderlyingReceiver, setUnparsedEntity, startDocument
 - 
Methods inherited from class net.sf.saxon.event.SequenceReceiverappend, decompose, flatten, getConfiguration, getErrorCodeForDecomposingFunctionItems, getPipelineConfiguration, getSystemId, handlesAppend
 
- 
 
- 
- 
- 
Constructor Detail- 
SimpleContentValidatorpublic SimpleContentValidator(ElementDecl declaration, SchemaType type, Receiver next) throws MissingComponentException Create a simple content validator- Parameters:
- declaration- The element declaration (may be null). Used to check fixed/default values
- type- The schema type of the element
- next- The next receiver in the pipeline
- Throws:
- MissingComponentException- if a validator cannot be constructed because the schema is incomplete
 
 
- 
 - 
Method Detail- 
getSchemaTypepublic SchemaType getSchemaType() Get the schema type against which we are validating- Specified by:
- getSchemaTypein class- ContentValidator
- Returns:
- the schema type
 
 - 
setSchemaTypepublic void setSchemaType(SchemaType type) throws MissingComponentException Set the schema type against which this validator is to perform validation- Parameters:
- type- the schema type
- Throws:
- MissingComponentException- if an unresolved reference is present
 
 - 
startElementpublic void startElement(NodeName elemName, SchemaType type, AttributeMap attributes, NamespaceMap namespaces, Location location, int properties) throws XPathException Output element start tag (for a child of the element being validated)- Specified by:
- startElementin interface- Receiver
- Overrides:
- startElementin class- AttributeValidator
- Parameters:
- elemName- the name of the element.
- type- the type annotation of the element.
- attributes- the attributes of this element
- namespaces- the in-scope namespaces of this element: generally this is all the in-scope namespaces, without relying on inheriting namespaces from parent elements
- location- an object providing information about the module, line, and column where the node originated
- properties- bit-significant properties of the element node. If there are no relevant properties, zero is supplied. The definitions of the bits are in class- ReceiverOption
- Throws:
- XPathException- if an error occurs
 
 - 
getChildValidatorprotected ContentValidator getChildValidator() Return a validator to handle the children of the element just started. This will only be called during error recovery, because an exception would have been thrown when the element was started- Specified by:
- getChildValidatorin class- ContentValidator
- Returns:
- the validator to be used to handle the children
 
 - 
characterspublic 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 interface- Receiver
- Overrides:
- charactersin class- AttributeValidator
- Parameters:
- chars- The character content
- locationId- the location of the node in the source, or of the instruction that created it
- properties- Additional properties @throws net.sf.saxon.trans.XPathException
- Throws:
- XPathException- if an error occurs
 
 - 
endElementpublic void endElement() throws XPathExceptionEnd of element being validated- Specified by:
- endElementin interface- Receiver
- Overrides:
- endElementin class- ProxyReceiver
- Throws:
- XPathException- if an error occurs
 
 
- 
 
-