public interface XmlValidator
Source
. Can be created via the XmlValidatorFactory
.
Instances of this class are designed to be thread safe.
XmlValidatorFactory.createValidator(org.springframework.core.io.Resource, String)
Modifier and Type | Method and Description |
---|---|
SAXParseException[] |
validate(Source source)
Validates the given
Source , and returns an array of SAXParseException s as result. |
SAXParseException[] |
validate(Source source,
ValidationErrorHandler errorHandler)
Validates the given
Source and ValidationErrorHandler , and returns an array of SAXParseException s as result. |
SAXParseException[] validate(Source source) throws IOException
Source
, and returns an array of SAXParseException
s as result. The array will
be empty if no validation errors are found.source
- the input documentSAXParseException
sIOException
- if the source
cannot be readXmlValidationException
- if the source
cannot be validatedSAXParseException[] validate(Source source, ValidationErrorHandler errorHandler) throws IOException
Source
and ValidationErrorHandler
, and returns an array of SAXParseException
s as result. The array will be empty if no validation errors are found.source
- the input documenterrorHandler
- the error handler to use. May be null
, in which case a default will be used.SAXParseException
sIOException
- if the source
cannot be readXmlValidationException
- if the source
cannot be validated