use of xades4j.xml.bind.xades.XmlIdentifierType in project xades4j by luisgoncalves.
the class ToXmlUtils method getXmlObjectId.
static XmlObjectIdentifierType getXmlObjectId(ObjectIdentifier objId) {
XmlObjectIdentifierType xmlObjId = new XmlObjectIdentifierType();
// Object identifier
XmlIdentifierType xmlId = new XmlIdentifierType();
xmlId.setValue(objId.getIdentifier());
// If it is IdentifierType.URI the converter returns null, which is the
// same as not specifying a qualifier.
xmlId.setQualifier(identifierTypeConv.get(objId.getIdentifierType()));
xmlObjId.setIdentifier(xmlId);
// Description
xmlObjId.setDescription(objId.getDescription());
return xmlObjId;
}
use of xades4j.xml.bind.xades.XmlIdentifierType in project xades4j by luisgoncalves.
the class ToXmlCommitmentTypeConverter method convertIntoObjectTree.
@Override
public void convertIntoObjectTree(PropertyDataObject propData, XmlSignedPropertiesType xmlProps, Document doc) {
CommitmentTypeData commitmentTypeData = (CommitmentTypeData) propData;
// Create the JAXB CommitmentTypeIndication and add it to SignedDataObjectProperties.
XmlCommitmentTypeIndicationType xmlCommitmentTypeProp = new XmlCommitmentTypeIndicationType();
xmlProps.getSignedDataObjectProperties().getCommitmentTypeIndication().add(xmlCommitmentTypeProp);
XmlIdentifierType xmlIdentifier = new XmlIdentifierType();
xmlIdentifier.setValue(commitmentTypeData.getUri());
XmlObjectIdentifierType xmlObjectId = new XmlObjectIdentifierType();
xmlObjectId.setDescription(commitmentTypeData.getDescription());
xmlObjectId.setIdentifier(xmlIdentifier);
xmlCommitmentTypeProp.setCommitmentTypeId(xmlObjectId);
Collection<String> refsUris = commitmentTypeData.getObjReferences();
if (null == refsUris) {
xmlCommitmentTypeProp.setAllSignedDataObjects();
} else {
xmlCommitmentTypeProp.getObjectReference().addAll(refsUris);
}
Collection qualifiers = commitmentTypeData.getQualifiers();
if (!qualifiers.isEmpty()) {
XmlCommitmentTypeQualifiersListType xmlQualifiers = new XmlCommitmentTypeQualifiersListType();
for (Object q : qualifiers) {
XmlAnyType xmlQualifier = new XmlAnyType();
xmlQualifier.getContent().add(q);
xmlQualifiers.getCommitmentTypeQualifier().add(xmlQualifier);
}
xmlCommitmentTypeProp.setCommitmentTypeQualifiers(xmlQualifiers);
}
}
Aggregations