Class XSDAbstractUtils

java.lang.Object
eu.europa.esig.dss.jaxb.common.XSDAbstractUtils
Direct Known Subclasses:
ASiCManifestUtils, MRAUtils, SAMLAssertionUtils, SoapEnvelopeUtils, TrustedListUtils, ValidationReportUtils, XAdES111Utils, XAdES122Utils, XAdES319132Utils, XAdESUtils, XmlDSigUtils, XMLEncUtils, XMLEvidenceRecordUtils

public abstract class XSDAbstractUtils extends Object
Abstract class for XSD Utils
  • Constructor Details

    • XSDAbstractUtils

      protected XSDAbstractUtils()
      Empty constructor
  • Method Details

    • getJAXBContext

      public abstract jakarta.xml.bind.JAXBContext getJAXBContext() throws jakarta.xml.bind.JAXBException
      Returns a JAXBContext
      Returns:
      the created JAXBContext
      Throws:
      jakarta.xml.bind.JAXBException - in case of an exception
    • getXSDSources

      public abstract List<Source> getXSDSources()
      Returns a list of module-specific XSD Sources
      Returns:
      list of XSD Sources
    • getSchema

      public Schema getSchema() throws SAXException
      Returns a default module Schema. The result is cached
      Returns:
      the created Schema
      Throws:
      SAXException - in case of an exception
    • getSchema

      public Schema getSchema(Source... sources) throws SAXException
      Returns a Schema with custom sources
      Parameters:
      sources - an array of custom Sources
      Returns:
      Schema
      Throws:
      SAXException - in case of an exception
    • validateAgainstXSD

      public List<String> validateAgainstXSD(Source xmlSource)
      This method allows to validate an XML against the module-default XSD schema.
      Parameters:
      xmlSource - Source XML to validate
      Returns:
      empty list if the XSD validates the XML, error messages otherwise
    • validateAgainstXSD

      public List<String> validateAgainstXSD(Source xmlSource, Source... schemaSources)
      This method allows to validate an XML against the module-default XSD schema plus custom sources.
      Parameters:
      xmlSource - Source XML to validate
      schemaSources - Sources to validate against (custom schemas)
      Returns:
      empty list if the XSD validates the XML, error messages otherwise
    • validate

      public void validate(Source xmlSource, Schema schema, boolean secureValidation) throws IOException
      This method allows to validate an XML against the module-default XSD schema plus custom sources.
      Parameters:
      xmlSource - the Sources to validate against (custom schemas)
      schema - the used Schema to validate
      secureValidation - enable/disable the secure validation (protection against XXE)
      Throws:
      IOException - if an exception occurs