Search in sources :

Example 1 with EnvironmentalMonitoringFacility

use of org.n52.shetland.inspire.ef.EnvironmentalMonitoringFacility 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 EnvironmentalMonitoringFacility

use of org.n52.shetland.inspire.ef.EnvironmentalMonitoringFacility in project arctic-sea by 52North.

the class EnvironmentalMonitoringFaciltityDocumentEncoder method encode.

@Override
public XmlObject encode(AbstractFeature abstractFeature, EncodingContext context) throws EncodingException {
    if (abstractFeature instanceof EnvironmentalMonitoringFacility) {
        EnvironmentalMonitoringFacilityDocument emfpd = EnvironmentalMonitoringFacilityDocument.Factory.newInstance();
        emfpd.setEnvironmentalMonitoringFacility(createEnvironmentalMonitoringFaciltityType((EnvironmentalMonitoringFacility) abstractFeature));
        return emfpd;
    }
    throw new UnsupportedEncoderInputException(this, abstractFeature);
}
Also used : EnvironmentalMonitoringFacilityDocument(eu.europa.ec.inspire.schemas.ef.x40.EnvironmentalMonitoringFacilityDocument) EnvironmentalMonitoringFacility(org.n52.shetland.inspire.ef.EnvironmentalMonitoringFacility) UnsupportedEncoderInputException(org.n52.svalbard.encode.exception.UnsupportedEncoderInputException)

Example 3 with EnvironmentalMonitoringFacility

use of org.n52.shetland.inspire.ef.EnvironmentalMonitoringFacility in project arctic-sea by 52North.

the class EnvironmentalMonitoringFaciltityPropertyTypeEncoder method encode.

@Override
public XmlObject encode(AbstractFeature abstractFeature, EncodingContext context) throws EncodingException {
    if (abstractFeature instanceof EnvironmentalMonitoringFacility) {
        EnvironmentalMonitoringFacilityPropertyType emfpt = EnvironmentalMonitoringFacilityPropertyType.Factory.newInstance();
        emfpt.setEnvironmentalMonitoringFacility(createEnvironmentalMonitoringFaciltityType((EnvironmentalMonitoringFacility) abstractFeature));
        return emfpt;
    }
    throw new UnsupportedEncoderInputException(this, abstractFeature);
}
Also used : EnvironmentalMonitoringFacility(org.n52.shetland.inspire.ef.EnvironmentalMonitoringFacility) EnvironmentalMonitoringFacilityPropertyType(eu.europa.ec.inspire.schemas.ef.x40.EnvironmentalMonitoringFacilityPropertyType) UnsupportedEncoderInputException(org.n52.svalbard.encode.exception.UnsupportedEncoderInputException)

Example 4 with EnvironmentalMonitoringFacility

use of org.n52.shetland.inspire.ef.EnvironmentalMonitoringFacility 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

EnvironmentalMonitoringFacility (org.n52.shetland.inspire.ef.EnvironmentalMonitoringFacility)2 UnsupportedEncoderInputException (org.n52.svalbard.encode.exception.UnsupportedEncoderInputException)2 EnvironmentalMonitoringFacilityDocument (eu.europa.ec.inspire.schemas.ef.x40.EnvironmentalMonitoringFacilityDocument)1 EnvironmentalMonitoringFacilityPropertyType (eu.europa.ec.inspire.schemas.ef.x40.EnvironmentalMonitoringFacilityPropertyType)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