Class Validator

java.lang.Object
org.xmlunit.validation.Validator
Direct Known Subclasses:
JAXPValidator, ParsingValidator

public abstract class Validator extends Object
Validates a piece of XML against a schema given in a supported language or the definition of such a schema itself.
  • Field Details

    • sourceLocations

      private Source[] sourceLocations
  • Constructor Details

    • Validator

      protected Validator()
  • Method Details

    • setSchemaSources

      public void setSchemaSources(Source... s)
      Where to find the schema.
    • setSchemaSource

      public final void setSchemaSource(Source s)
      Where to find the schema.
    • getSchemaSources

      protected Source[] getSchemaSources()
      Where to find the schema.
    • validateSchema

      public abstract ValidationResult validateSchema()
      Validates a schema.
      Throws:
      UnsupportedOperationException - if the language's implementation doesn't support schema validation
    • validateInstance

      public abstract ValidationResult validateInstance(Source instance)
      Validates an instance against the schema.
    • forLanguage

      public static Validator forLanguage(String language)
      Factory that obtains a Validator instance based on the schema language.
      See Also: