Search in sources :

Example 1 with XmlDocumentationReferencesType

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

the class FromXmlDataObjFormatPropertyConverter method convertFromObjectTree.

@Override
public void convertFromObjectTree(XmlSignedDataObjectPropertiesType xmlProps, QualifyingPropertiesDataCollector propertyDataCollector) throws PropertyUnmarshalException {
    List<XmlDataObjectFormatType> xmlFormats = xmlProps.getDataObjectFormat();
    if (xmlFormats.isEmpty())
        return;
    for (XmlDataObjectFormatType xmlDataObjFormat : xmlFormats) {
        XmlObjectIdentifierType xmlObjId = xmlDataObjFormat.getObjectIdentifier();
        DataObjectFormatData dataObjFormatData = new DataObjectFormatData(xmlDataObjFormat.getObjectReference());
        dataObjFormatData.setIdentifier(FromXmlUtils.getObjectIdentifier(xmlObjId));
        dataObjFormatData.setMimeType(xmlDataObjFormat.getMimeType());
        dataObjFormatData.setEncoding(xmlDataObjFormat.getEncoding());
        dataObjFormatData.setDescription(xmlDataObjFormat.getDescription());
        if (xmlObjId != null) {
            XmlDocumentationReferencesType docRefs = xmlDataObjFormat.getObjectIdentifier().getDocumentationReferences();
            if (docRefs != null && !docRefs.getDocumentationReference().isEmpty())
                dataObjFormatData.setDocumentationUris(docRefs.getDocumentationReference());
        }
        propertyDataCollector.addDataObjectFormat(dataObjFormatData);
    }
}
Also used : XmlDocumentationReferencesType(xades4j.xml.bind.xades.XmlDocumentationReferencesType) DataObjectFormatData(xades4j.properties.data.DataObjectFormatData) XmlDataObjectFormatType(xades4j.xml.bind.xades.XmlDataObjectFormatType) XmlObjectIdentifierType(xades4j.xml.bind.xades.XmlObjectIdentifierType)

Example 2 with XmlDocumentationReferencesType

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

the class ToXmlDataObjectFormatConverter method getXmlObjId.

private XmlObjectIdentifierType getXmlObjId(DataObjectFormatData dataObjFormatData) {
    ObjectIdentifier identifier = dataObjFormatData.getIdentifier();
    if (null == identifier)
        return null;
    XmlObjectIdentifierType xmlObjId = ToXmlUtils.getXmlObjectId(identifier);
    // Documentation references
    Collection<String> docsUris = dataObjFormatData.getDocumentationUris();
    if (docsUris != null && !docsUris.isEmpty()) {
        XmlDocumentationReferencesType docRefs = new XmlDocumentationReferencesType();
        docRefs.getDocumentationReference().addAll(docsUris);
        xmlObjId.setDocumentationReferences(docRefs);
    }
    return xmlObjId;
}
Also used : XmlDocumentationReferencesType(xades4j.xml.bind.xades.XmlDocumentationReferencesType) XmlObjectIdentifierType(xades4j.xml.bind.xades.XmlObjectIdentifierType) ObjectIdentifier(xades4j.properties.ObjectIdentifier)

Aggregations

XmlDocumentationReferencesType (xades4j.xml.bind.xades.XmlDocumentationReferencesType)2 XmlObjectIdentifierType (xades4j.xml.bind.xades.XmlObjectIdentifierType)2 ObjectIdentifier (xades4j.properties.ObjectIdentifier)1 DataObjectFormatData (xades4j.properties.data.DataObjectFormatData)1 XmlDataObjectFormatType (xades4j.xml.bind.xades.XmlDataObjectFormatType)1