Class XmlSchemaValidator

  • All Implemented Interfaces:
    Validator

    public class XmlSchemaValidator
    extends java.lang.Object
    implements Validator
    Validate an XML instance against an XML Schema.
    • Constructor Summary

      Constructors 
      Constructor Description
      XmlSchemaValidator​(java.io.File xmlSchema)
      Create an instance.
      XmlSchemaValidator​(java.io.InputStream xmlSchema)
      Create an instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void validate​(java.io.InputStream xmlInstance)
      Validate that the contents of a stream meets the expectations.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XmlSchemaValidator

        public XmlSchemaValidator​(java.io.File xmlSchema)
                           throws java.io.IOException
        Create an instance.
        Parameters:
        xmlSchema - The XML Schema to use for validation
        Throws:
        java.io.IOException - When the schema could not be found
      • XmlSchemaValidator

        public XmlSchemaValidator​(java.io.InputStream xmlSchema)
        Create an instance.
        Parameters:
        xmlSchema - The XML Schema to use for validation
    • Method Detail

      • validate

        public void validate​(java.io.InputStream xmlInstance)
        Description copied from interface: Validator
        Validate that the contents of a stream meets the expectations.
        Specified by:
        validate in interface Validator
        Parameters:
        xmlInstance - The stream to validate