Class XSDValidator

java.lang.Object
eu.europa.ec.taxud.validation.validator.BaseValidator
eu.europa.ec.taxud.validation.validator.XSDValidator
All Implemented Interfaces:
Validator

public class XSDValidator extends BaseValidator
XSDValidator handles the validation of a file according to the XSD.
Version:
$Revision : 99 $
  • Constructor Details

    • XSDValidator

      public XSDValidator()
      Instantiates a new XSD Validator and load all registered ValidationErrorHandler using service-provider loading facility.
  • Method Details

    • addXsdPath

      public void addXsdPath(String xsdPath)
      Add XSD path to ist of XSD.
      Parameters:
      xsdPath - A XSD Path to add.
    • getSchema

      protected Schema getSchema()
      Return XSD Schema with all available XSD files.
      Returns:
      Schema Schema to be applied
    • getValidator

      protected Validator getValidator()
      Return XML validator.
      Returns:
      Validator The XML validator
    • process

      public void process(ValidationInput input, ValidationContext context)
      Validates a file against the XSD.
      Parameters:
      input - the input file.
      context - Context information for process.
    • recoverValidationFailure

      protected void recoverValidationFailure(ValidationInput input, ValidationContext context)
      Callback to recover from potential XSD errors. Does nothing by default.
      Parameters:
      input - the input file.
      context - Context information for process.
    • getSource

      protected StreamSource getSource(ValidationInput input)
      Gets source.
      Parameters:
      input - the input
      Returns:
      the source
    • closeSource

      protected void closeSource(ValidationInput input, StreamSource source)
      Close source.
      Parameters:
      input - the input
      source - the source
    • checkXMLDeclaration

      protected void checkXMLDeclaration(ValidationInput input, ValidationContext context) throws ValidationException
      Check xml declaration.
      Parameters:
      input - the input
      context - the context
      Throws:
      ValidationException - the validation exception
    • checkXMLWellFormed

      protected boolean checkXMLWellFormed(ValidationInput input, ValidationContext context) throws ValidationException
      Check xml well formed boolean.
      Parameters:
      input - the input
      context - the context
      Returns:
      the boolean
      Throws:
      ValidationException - the validation exception