Search in sources :

Example 1 with MDDataIdentificationPropertyType

use of org.isotc211.x2005.gmd.MDDataIdentificationPropertyType 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;
}
Also used : MDDataIdentificationType(org.isotc211.x2005.gmd.MDDataIdentificationType) MDDataIdentificationPropertyType(org.isotc211.x2005.gmd.MDDataIdentificationPropertyType) MDDataIdentificationDocument(org.isotc211.x2005.gmd.MDDataIdentificationDocument)

Aggregations

MDDataIdentificationDocument (org.isotc211.x2005.gmd.MDDataIdentificationDocument)1 MDDataIdentificationPropertyType (org.isotc211.x2005.gmd.MDDataIdentificationPropertyType)1 MDDataIdentificationType (org.isotc211.x2005.gmd.MDDataIdentificationType)1