use of jakarta.xml.bind.JAXBElement in project xades4j by luisgoncalves.
the class FromXmlSignaturePolicyConverter method getLocationUrl.
private static String getLocationUrl(XmlSignaturePolicyIdType xmlPolicyId) throws PropertyUnmarshalException {
XmlSigPolicyQualifiersListType sigPolicyQualifiers = xmlPolicyId.getSigPolicyQualifiers();
if (null == sigPolicyQualifiers) {
return null;
}
List<XmlAnyType> xmlQualifiers = sigPolicyQualifiers.getSigPolicyQualifier();
for (XmlAnyType xmlQualifier : xmlQualifiers) {
List content = xmlQualifier.getContent();
if (content.size() == 1 && content.get(0) instanceof JAXBElement) {
JAXBElement xmlSPURI = (JAXBElement) content.get(0);
if (xmlSPURI.getName().getLocalPart().equals("SPURI") && xmlSPURI.getName().getNamespaceURI().equals(QualifyingProperty.XADES_XMLNS)) {
return (String) xmlSPURI.getValue();
}
}
}
return null;
}
Aggregations