use of org.n52.shetland.inspire.base2.DocumentCitation in project arctic-sea by 52North.
the class DocumentCitationTypeDecoder method decode.
@Override
public DocumentCitation decode(XmlObject xmlObject) throws DecodingException {
if (xmlObject instanceof DocumentCitationType) {
DocumentCitation documentCitation = new DocumentCitation();
DocumentCitationType dct = (DocumentCitationType) xmlObject;
documentCitation.setDescription(dct.getDescription().getStringValue());
if (dct.isNilDate()) {
if (dct.getDate().isSetNilReason()) {
documentCitation.setDate(Nillable.<DateTime>nil(dct.getDate().getNilReason().toString()));
}
} else {
documentCitation.setDate(new DateTime(dct.getDate().getCIDate().getDate().getDate().getTime()));
}
if (dct.getLinkArray() != null) {
for (Link link : dct.getLinkArray()) {
if (link.isNil() && link.isSetNilReason()) {
documentCitation.addLink(Nillable.<String>nil(link.getNilReason().toString()));
} else {
documentCitation.addLink(link.getStringValue());
}
}
}
return documentCitation;
}
throw new UnsupportedDecoderInputException(this, xmlObject);
}
Aggregations