Class ConformityChecker

java.lang.Object
io.github.oliviercailloux.jaris.xml.ConformityChecker

public class ConformityChecker extends Object

Helper for validating documents.

Instances of this class fail fast (throwing an exception) if encountering a warning, an error or a fatalError upon validating a document.

  • Method Details

    • verifyValid

      public void verifyValid(Source document) throws VerifyException, XmlException, IOException
      Throws an exception iff the provided document is invalid.
      Parameters:
      document - the document to validate.
      Throws:
      VerifyException - iff the document is invalid, equivalently, iff a warning, error or fatalError is encountered while validating the provided document
      XmlException - if the Source is an XML artifact that the implementation cannot validate (for example, a processing instruction)
      IOException - if the validator is processing a javax.xml.transform.sax.SAXSource and the underlying org.xml.sax.XMLReader throws an IOException.