Search in sources :

Example 1 with XmlQualifyingPropertiesType

use of xades4j.xml.bind.xades.XmlQualifyingPropertiesType in project xades4j by luisgoncalves.

the class DefaultQualifyingPropertiesUnmarshaller method unmarshalProperties.

@Override
public void unmarshalProperties(Element qualifyingProps, QualifyingPropertiesDataCollector propertyDataCollector) throws UnmarshalException {
    XmlQualifyingPropertiesType xmlQualifyingProps = null;
    try {
        // Create the JAXB unmarshaller and unmarshalProperties the root JAXB element
        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
        JAXBElement<XmlQualifyingPropertiesType> qualifPropsElem = (JAXBElement<XmlQualifyingPropertiesType>) unmarshaller.unmarshal(qualifyingProps);
        xmlQualifyingProps = qualifPropsElem.getValue();
    } catch (jakarta.xml.bind.UnmarshalException ex) {
        throw new UnmarshalException("Cannot bind XML elements to Java classes", ex);
    } catch (JAXBException ex) {
        throw new UnmarshalException("Cannot unmarshall properties. Error on JAXB unmarshalling.", ex);
    }
    // Iterate the modules to convert the different types of properties.
    for (UnmarshallerModule module : modules) {
        module.convertProperties(xmlQualifyingProps, qualifyingProps, propertyDataCollector);
    }
}
Also used : XmlQualifyingPropertiesType(xades4j.xml.bind.xades.XmlQualifyingPropertiesType) JAXBException(jakarta.xml.bind.JAXBException) JAXBElement(jakarta.xml.bind.JAXBElement) Unmarshaller(jakarta.xml.bind.Unmarshaller)

Aggregations

JAXBElement (jakarta.xml.bind.JAXBElement)1 JAXBException (jakarta.xml.bind.JAXBException)1 Unmarshaller (jakarta.xml.bind.Unmarshaller)1 XmlQualifyingPropertiesType (xades4j.xml.bind.xades.XmlQualifyingPropertiesType)1