use of org.isotc211.x2005.gmd.MDDataIdentificationDocument in project arctic-sea by 52North.
the class Iso19139GmdEncoder method encodeMDDataIdentification.
private XmlObject encodeMDDataIdentification(MDDataIdentification mdDataIdentification, EncodingContext context) {
if (mdDataIdentification.isSetSimpleAttrs()) {
MDDataIdentificationPropertyType mddipt = MDDataIdentificationPropertyType.Factory.newInstance(getXmlOptions());
mddipt.setHref(mdDataIdentification.getSimpleAttrs().getHref());
if (mdDataIdentification.getSimpleAttrs().isSetTitle()) {
mddipt.setTitle(mdDataIdentification.getSimpleAttrs().getTitle());
}
if (mdDataIdentification.getSimpleAttrs().isSetRole()) {
mddipt.setRole(mdDataIdentification.getSimpleAttrs().getRole());
}
return mddipt;
}
MDDataIdentificationType mddit = MDDataIdentificationType.Factory.newInstance(getXmlOptions());
encodeIdentificationInfo(mddit, mdDataIdentification);
// language
mddit.addNewLanguage().setCharacterString(mdDataIdentification.getLanguage());
// TODO all other optional elements if required
if (context.has(XmlBeansEncodingFlags.PROPERTY_TYPE)) {
MDDataIdentificationPropertyType mddipt = MDDataIdentificationPropertyType.Factory.newInstance(getXmlOptions());
mddipt.setMDDataIdentification(mddit);
return mddipt;
} else if (context.has(XmlBeansEncodingFlags.DOCUMENT)) {
MDDataIdentificationDocument mddid = MDDataIdentificationDocument.Factory.newInstance(getXmlOptions());
mddid.setMDDataIdentification(mddit);
return mddit;
}
return mddit;
}
Aggregations