Search in sources :

Example 1 with EnvironmentalMonitoringFacilityType

use of eu.europa.ec.inspire.schemas.ef.x40.EnvironmentalMonitoringFacilityType in project arctic-sea by 52North.

the class AbstractEnvironmentalMonitoringFaciltityEncoder method setRelatedTo.

private void setRelatedTo(EnvironmentalMonitoringFacilityType emft, EnvironmentalMonitoringFacility environmentalMonitoringFacility) throws EncodingException {
    if (environmentalMonitoringFacility.isSetRelatedTo()) {
        for (AnyDomainLink relatedTo : environmentalMonitoringFacility.getRelatedTo()) {
            if (relatedTo.isSetSimpleAttrs()) {
                RelatedTo rt = emft.addNewRelatedTo();
                rt.setHref(relatedTo.getSimpleAttrs().getHref());
                if (relatedTo.getSimpleAttrs().isSetTitle()) {
                    rt.setTitle(relatedTo.getSimpleAttrs().getTitle());
                }
            } else {
                emft.addNewRelatedTo().addNewAnyDomainLink().set(encodeEF(relatedTo));
            }
        }
    }
}
Also used : AnyDomainLink(org.n52.shetland.inspire.ef.AnyDomainLink) RelatedTo(eu.europa.ec.inspire.schemas.ef.x40.EnvironmentalMonitoringFacilityType.RelatedTo)

Example 2 with EnvironmentalMonitoringFacilityType

use of eu.europa.ec.inspire.schemas.ef.x40.EnvironmentalMonitoringFacilityType in project arctic-sea by 52North.

the class AbstractEnvironmentalMonitoringFaciltityEncoder method createFeature.

@Override
protected XmlObject createFeature(FeaturePropertyType featurePropertyType, AbstractFeature abstractFeature, EncodingContext context) throws EncodingException {
    if (context.has(XmlBeansEncodingFlags.ENCODE) && !context.getBoolean(XmlBeansEncodingFlags.ENCODE)) {
        featurePropertyType.setHref(abstractFeature.getIdentifierCodeWithAuthority().getValue());
        if (abstractFeature.isSetName()) {
            featurePropertyType.setTitle(abstractFeature.getFirstName().getValue());
        }
        return featurePropertyType;
    }
    EnvironmentalMonitoringFacilityType emft = createEnvironmentalMonitoringFaciltityType((EnvironmentalMonitoringFacility) abstractFeature);
    EnvironmentalMonitoringFacilityDocument emfd = EnvironmentalMonitoringFacilityDocument.Factory.newInstance(getXmlOptions());
    emfd.setEnvironmentalMonitoringFacility(emft);
    return emfd;
}
Also used : EnvironmentalMonitoringFacilityType(eu.europa.ec.inspire.schemas.ef.x40.EnvironmentalMonitoringFacilityType) EnvironmentalMonitoringFacilityDocument(eu.europa.ec.inspire.schemas.ef.x40.EnvironmentalMonitoringFacilityDocument)

Example 3 with EnvironmentalMonitoringFacilityType

use of eu.europa.ec.inspire.schemas.ef.x40.EnvironmentalMonitoringFacilityType in project arctic-sea by 52North.

the class AbstractEnvironmentalMonitoringFaciltityEncoder method setBelongsTo.

private void setBelongsTo(EnvironmentalMonitoringFacilityType emft, EnvironmentalMonitoringFacility environmentalMonitoringFacility) throws EncodingException {
    if (environmentalMonitoringFacility.isSetBelongsTo()) {
        for (NetworkFacility belongsTo : environmentalMonitoringFacility.getBelongsTo()) {
            if (belongsTo.isSetSimpleAttrs()) {
                BelongsTo bt = emft.addNewBelongsTo();
                bt.setHref(belongsTo.getSimpleAttrs().getHref());
                if (belongsTo.getSimpleAttrs().isSetTitle()) {
                    bt.setTitle(belongsTo.getSimpleAttrs().getTitle());
                }
            } else {
                emft.addNewBelongsTo().addNewNetworkFacility().set(encodeEF(belongsTo));
            }
        }
    }
}
Also used : BelongsTo(eu.europa.ec.inspire.schemas.ef.x40.EnvironmentalMonitoringFacilityType.BelongsTo) NetworkFacility(org.n52.shetland.inspire.ef.NetworkFacility)

Aggregations

EnvironmentalMonitoringFacilityDocument (eu.europa.ec.inspire.schemas.ef.x40.EnvironmentalMonitoringFacilityDocument)1 EnvironmentalMonitoringFacilityType (eu.europa.ec.inspire.schemas.ef.x40.EnvironmentalMonitoringFacilityType)1 BelongsTo (eu.europa.ec.inspire.schemas.ef.x40.EnvironmentalMonitoringFacilityType.BelongsTo)1 RelatedTo (eu.europa.ec.inspire.schemas.ef.x40.EnvironmentalMonitoringFacilityType.RelatedTo)1 AnyDomainLink (org.n52.shetland.inspire.ef.AnyDomainLink)1 NetworkFacility (org.n52.shetland.inspire.ef.NetworkFacility)1