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 JAXBContextgetJAXBContext()Returns a JAXBContextSchemagetSchema()Returns a default moduleSchema.SchemagetSchema(Source... sources)Returns a Schema with custom sourcesabstract List<Source>getXSDSources()Returns a list of module-specific XSDSourcesvoidvalidate(Source xmlSource, Schema schema, boolean secureValidation)This method allows to validate an XML against the module-default XSD schema plus custom sources.StringvalidateAgainstXSD(Source xmlSource)This method allows to validate an XML against the module-default XSD schema.StringvalidateAgainstXSD(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 XSDSources- Returns:
- list of XSD
Sources
-
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 customSources- 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-SourceXML 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-SourceXML to validateschemaSources-Sources 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- theSources to validate against (custom schemas)schema- the usedSchemato validatesecureValidation- enable/disable the secure validation (protection against XXE)- Throws:
SAXExceptionIOException
-