Package eu.europa.esig.dss.jaxb.common
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
Abstract class for XSD Utils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract jakarta.xml.bind.JAXBContext
Returns a JAXBContextReturns a default moduleSchema
.Returns a Schema with custom sourcesReturns a list of module-specific XSDSource
svoid
This method allows to validate an XML against the module-default XSD schema plus custom sources.validateAgainstXSD
(Source xmlSource) This method allows to validate an XML against the module-default XSD schema.validateAgainstXSD
(Source xmlSource, Source... schemaSources) This method allows to validate an XML against the module-default XSD schema plus custom sources.
-
Constructor Details
-
XSDAbstractUtils
protected XSDAbstractUtils()Empty constructor
-
-
Method Details
-
getJAXBContext
public abstract jakarta.xml.bind.JAXBContext getJAXBContext() throws jakarta.xml.bind.JAXBExceptionReturns a JAXBContext- Returns:
- the created
JAXBContext
- Throws:
jakarta.xml.bind.JAXBException
- in case of an exception
-
getXSDSources
-
getSchema
Returns a default moduleSchema
. The result is cached- Returns:
- the created
Schema
- Throws:
SAXException
- in case of an exception
-
getSchema
Returns a Schema with custom sources- Parameters:
sources
- an array of customSource
s- Returns:
Schema
- Throws:
SAXException
- in case of an exception
-
validateAgainstXSD
-
validateAgainstXSD
This method allows to validate an XML against the module-default XSD schema plus custom sources.- Parameters:
xmlSource
-Source
XML to validateschemaSources
-Source
s to validate against (custom schemas)- Returns:
- empty list if the XSD validates the XML, error messages otherwise
-
validate
This method allows to validate an XML against the module-default XSD schema plus custom sources.- Parameters:
xmlSource
- theSource
s to validate against (custom schemas)schema
- the usedSchema
to validatesecureValidation
- enable/disable the secure validation (protection against XXE)- Throws:
IOException
- if an exception occurs
-