Class ValidationPolicyFacade
java.lang.Object
eu.europa.esig.dss.jaxb.common.AbstractJaxbFacade<ConstraintsParameters>
eu.europa.esig.dss.policy.ValidationPolicyFacade
Used to read an XML validation policy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected jakarta.xml.bind.JAXBContextThis method returns the instance ofJAXBContextwhich can handle the JAXB Objectprotected SchemaThis method returns an instance ofSchemawith the loaded XML Schema(s).getValidationPolicy(File file) Gets the validation policy from thefileGets the validation policy from theisgetValidationPolicy(String path) Gets the validation policy from thepathstatic ValidationPolicyFacadeInitializes a newValidationPolicyFacadeprotected jakarta.xml.bind.JAXBElement<ConstraintsParameters> wrap(ConstraintsParameters jaxbObject) This method wraps/envelops the JAXB object with a "root" elementMethods inherited from class AbstractJaxbFacade
getMarshaller, getUnmarshaller, marshall, marshall, marshall, marshall, unmarshall, unmarshall, unmarshall, unmarshall, unmarshall, unmarshall
-
Constructor Details
-
ValidationPolicyFacade
protected ValidationPolicyFacade()Default constructor
-
-
Method Details
-
newFacade
Initializes a newValidationPolicyFacade- Returns:
ValidationPolicyFacade
-
getJAXBContext
protected jakarta.xml.bind.JAXBContext getJAXBContext() throws jakarta.xml.bind.JAXBExceptionDescription copied from class:AbstractJaxbFacadeThis method returns the instance ofJAXBContextwhich can handle the JAXB Object- Specified by:
getJAXBContextin classAbstractJaxbFacade<ConstraintsParameters>- Returns:
- an instance of
JAXBContext - Throws:
jakarta.xml.bind.JAXBException- if an error occurred in the initialization process
-
getSchema
Description copied from class:AbstractJaxbFacadeThis method returns an instance ofSchemawith the loaded XML Schema(s). The XSD(s) allows to validate the JAXB Object.- Specified by:
getSchemain classAbstractJaxbFacade<ConstraintsParameters>- Returns:
- an instance of
Schema - Throws:
IOException- if an I/O error occurred in the initialization processSAXException- if a SAX error occurred in the initialization process
-
wrap
protected jakarta.xml.bind.JAXBElement<ConstraintsParameters> wrap(ConstraintsParameters jaxbObject) Description copied from class:AbstractJaxbFacadeThis method wraps/envelops the JAXB object with a "root" element- Specified by:
wrapin classAbstractJaxbFacade<ConstraintsParameters>- Parameters:
jaxbObject- the JAXB object to be enveloped to marshall- Returns:
- the enveloped JAXB object, ready to be marshalled
-
getValidationPolicy
public ValidationPolicy getValidationPolicy(String path) throws jakarta.xml.bind.JAXBException, XMLStreamException, IOException, SAXException Gets the validation policy from thepath- Parameters:
path-String- Returns:
ValidationPolicy- Throws:
jakarta.xml.bind.JAXBException- ifJAXBExceptionoccursXMLStreamException- ifXMLStreamExceptionoccursIOException- ifIOExceptionoccursSAXException- ifSAXExceptionoccurs
-
getValidationPolicy
public ValidationPolicy getValidationPolicy(InputStream is) throws jakarta.xml.bind.JAXBException, XMLStreamException, IOException, SAXException Gets the validation policy from theis- Parameters:
is-InputStream- Returns:
ValidationPolicy- Throws:
jakarta.xml.bind.JAXBException- ifJAXBExceptionoccursXMLStreamException- ifXMLStreamExceptionoccursIOException- ifIOExceptionoccursSAXException- ifSAXExceptionoccurs
-
getValidationPolicy
public ValidationPolicy getValidationPolicy(File file) throws jakarta.xml.bind.JAXBException, XMLStreamException, IOException, SAXException Gets the validation policy from thefile- Parameters:
file-File- Returns:
ValidationPolicy- Throws:
jakarta.xml.bind.JAXBException- ifJAXBExceptionoccursXMLStreamException- ifXMLStreamExceptionoccursIOException- ifIOExceptionoccursSAXException- ifSAXExceptionoccurs
-