Search in sources :

Example 1 with EnvironmentalMonitoringFacilityDocument

use of eu.europa.ec.inspire.schemas.ef.x40.EnvironmentalMonitoringFacilityDocument 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 2 with EnvironmentalMonitoringFacilityDocument

use of eu.europa.ec.inspire.schemas.ef.x40.EnvironmentalMonitoringFacilityDocument 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)

Aggregations

EnvironmentalMonitoringFacilityDocument (eu.europa.ec.inspire.schemas.ef.x40.EnvironmentalMonitoringFacilityDocument)2 EnvironmentalMonitoringFacilityType (eu.europa.ec.inspire.schemas.ef.x40.EnvironmentalMonitoringFacilityType)1 EnvironmentalMonitoringFacility (org.n52.shetland.inspire.ef.EnvironmentalMonitoringFacility)1 UnsupportedEncoderInputException (org.n52.svalbard.encode.exception.UnsupportedEncoderInputException)1