public interface Validatable
Interface defines methods for starting and stopping validation against specific schemas, or validator instances, as well as method(s) for adding an optional custom problem handler.
Modifier and Type | Method and Description |
---|---|
ValidationProblemHandler |
setValidationProblemHandler(ValidationProblemHandler h)
Method that application can call to define a custom handler for
validation problems encountered during validation process.
|
XMLValidator |
stopValidatingAgainst(XMLValidationSchema schema)
Method that can be called by application to stop validating
output against a schema, for which
validateAgainst(org.codehaus.stax2.validation.XMLValidationSchema)
was called earlier. |
XMLValidator |
stopValidatingAgainst(XMLValidator validator)
Method that can be called by application to stop validating
output using specified validator.
|
XMLValidator |
validateAgainst(XMLValidationSchema schema)
Method that will construct a
XMLValidator instance from the
given schema (unless a validator for that schema has already been
added),
initialize it if necessary, and make validatable object (reader,
writer)
call appropriate validation methods from this point on until the
end of the document (that is, it's not scoped with sub-trees), or until
validator is removed by an explicit call to
stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidationSchema) . |
XMLValidator validateAgainst(XMLValidationSchema schema) throws XMLStreamException
XMLValidator
instance from the
given schema (unless a validator for that schema has already been
added),
initialize it if necessary, and make validatable object (reader,
writer)
call appropriate validation methods from this point on until the
end of the document (that is, it's not scoped with sub-trees), or until
validator is removed by an explicit call to
stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidationSchema)
.
Note that while this method can be called at any point in output processing, validator instances are not required to be able to handle addition at other points than right before outputting the root element.
XMLStreamException
XMLValidator stopValidatingAgainst(XMLValidationSchema schema) throws XMLStreamException
validateAgainst(org.codehaus.stax2.validation.XMLValidationSchema)
was called earlier.XMLStreamException
XMLValidator stopValidatingAgainst(XMLValidator validator) throws XMLStreamException
validateAgainst(org.codehaus.stax2.validation.XMLValidationSchema)
.
Note: the specified validator is compared for identity with validators in use, not for equality.
validator
)
if it was being used for validating current document; null if not.XMLStreamException
ValidationProblemHandler setValidationProblemHandler(ValidationProblemHandler h)
h
- Handler to install, if non null; if null, indicates that
the default (implementation-specific) handling should be usedCopyright © 2015 fasterxml.com. All Rights Reserved.