Interface XmlValidator
public interface XmlValidator
Simple processor that validates a given
Source. Can be created via the XmlValidatorFactory.
Instances of this class are designed to be thread safe.
- Since:
- 1.0.0
- Author:
- Arjen Poutsma
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionValidates the givenSource, and returns an array ofSAXParseExceptions as result.validate(Source source, ValidationErrorHandler errorHandler) Validates the givenSourceandValidationErrorHandler, and returns an array ofSAXParseExceptions as result.
-
Method Details
-
validate
Validates the givenSource, and returns an array ofSAXParseExceptions as result. The array will be empty if no validation errors are found.- Parameters:
source- the input document- Returns:
- an array of
SAXParseExceptions - Throws:
IOException- if thesourcecannot be readXmlValidationException- if thesourcecannot be validated
-
validate
Validates the givenSourceandValidationErrorHandler, and returns an array ofSAXParseExceptions as result. The array will be empty if no validation errors are found.- Parameters:
source- the input documenterrorHandler- the error handler to use. May benull, in which case a default will be used.- Returns:
- an array of
SAXParseExceptions - Throws:
IOException- if thesourcecannot be readXmlValidationException- if thesourcecannot be validated
-