Spring Web Services Framework

org.springframework.xml.validation
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:
XmlValidatorFactory.createValidator(org.springframework.core.io.Resource, String)

Method Summary
 SAXParseException[] validate(Source source)
          Validates the given Source, and returns an array of SAXParseExceptions as result.
 SAXParseException[] validate(Source source, ValidationErrorHandler errorHandler)
          Validates the given Source and ValidationErrorHandler, and returns an array of SAXParseExceptions as result.
 

Method Detail

validate

SAXParseException[] validate(Source source)
                             throws IOException
Validates the given Source, and returns an array of SAXParseExceptions 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 the source cannot be read
XmlValidationException - if the source cannot be validated

validate

SAXParseException[] validate(Source source,
                             ValidationErrorHandler errorHandler)
                             throws IOException
Validates the given Source and ValidationErrorHandler, and returns an array of SAXParseExceptions as result. The array will be empty if no validation errors are found.

Parameters:
source - the input document
errorHandler - the error handler to use. May be null, in which case a default will be used.
Returns:
an array of SAXParseExceptions
Throws:
IOException - if the source cannot be read
XmlValidationException - if the source cannot be validated

Spring Web Services Framework

Copyright © 2005-2013 The Spring Web Services Framework. All Rights Reserved.