Package eu.europa.esig.xmldsig
Class XSDAbstractUtils
java.lang.Object
eu.europa.esig.xmldsig.XSDAbstractUtils
- Direct Known Subclasses:
ASiCManifestUtils
,SAMLAssertionUtils
,SoapEnvelopeUtils
,TrustedListUtils
,ValidationReportUtils
,XAdES111Utils
,XAdES122Utils
,XAdES319132Utils
,XAdESUtils
,XmlDSigUtils
,XMLEncUtils
public abstract class XSDAbstractUtils extends Object
-
Constructor Summary
Constructors Constructor Description XSDAbstractUtils()
-
Method Summary
Modifier and Type Method Description abstract JAXBContext
getJAXBContext()
Returns a JAXBContextSchema
getSchema()
Returns a default moduleSchema
.Schema
getSchema(Source... sources)
Returns a Schema with custom sourcesabstract List<Source>
getXSDSources()
Returns a list of module-specific XSDSource
svoid
validate(Source xmlSource, Schema schema, boolean secureValidation)
This method allows to validate an XML against the module-default XSD schema plus custom sources.String
validateAgainstXSD(Source xmlSource)
This method allows to validate an XML against the module-default XSD schema.String
validateAgainstXSD(Source xmlSource, Source... schemaSources)
This method allows to validate an XML against the module-default XSD schema plus custom sources.
-
Constructor Details
-
XSDAbstractUtils
public XSDAbstractUtils()
-
-
Method Details
-
getJAXBContext
Returns a JAXBContext- Returns:
- the created
JAXBContext
- Throws:
JAXBException
- in case of an exception
-
getXSDSources
Returns a list of module-specific XSDSource
s- Returns:
- list of XSD
Source
s
-
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
This method allows to validate an XML against the module-default XSD schema.- Parameters:
xmlSource
-Source
XML to validate- Returns:
- null if the XSD validates the XML, error message otherwise
-
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:
- null if the XSD validates the XML, error message otherwise
-
validate
public void validate(Source xmlSource, Schema schema, boolean secureValidation) throws SAXException, IOExceptionThis 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:
SAXException
IOException
-