Search in sources :

Example 6 with SweObservableProperty

use of org.n52.shetland.ogc.swe.simpleType.SweObservableProperty in project arctic-sea by 52North.

the class SensorMLDecoderV20 method parseObservableProperty.

/**
 * Parse {@link ObservablePropertyType}
 *
 * @param opt
 *            Object to parse
 * @return Parsed {@link SweObservableProperty}
 */
private SweObservableProperty parseObservableProperty(ObservablePropertyType opt) {
    SweObservableProperty observableProperty = new SweObservableProperty();
    observableProperty.setDefinition(opt.getDefinition());
    if (opt.isSetDescription()) {
        observableProperty.setDescription(opt.getDescription());
    }
    if (opt.isSetIdentifier()) {
        observableProperty.setIdentifier(opt.getIdentifier());
    }
    if (opt.isSetLabel()) {
        observableProperty.setLabel(opt.getLabel());
    }
    return observableProperty;
}
Also used : SweObservableProperty(org.n52.shetland.ogc.swe.simpleType.SweObservableProperty)

Example 7 with SweObservableProperty

use of org.n52.shetland.ogc.swe.simpleType.SweObservableProperty in project arctic-sea by 52North.

the class SweCommonEncoderv101 method createSimpleType.

private AbstractDataComponentType createSimpleType(SweAbstractSimpleType<?> sosSimpleType, EncodingContext additionalValues) throws EncodingException {
    AbstractDataComponentType abstractDataComponentType = null;
    if (sosSimpleType instanceof SweBoolean) {
        abstractDataComponentType = createBoolean((SweBoolean) sosSimpleType);
    } else if (sosSimpleType instanceof SweCategory) {
        abstractDataComponentType = createCategory((SweCategory) sosSimpleType);
    } else if (sosSimpleType instanceof SweCount) {
        abstractDataComponentType = createCount((SweCount) sosSimpleType);
    } else if (sosSimpleType instanceof SweCountRange) {
        abstractDataComponentType = createCountRange((SweCountRange) sosSimpleType);
    } else if (sosSimpleType instanceof SweObservableProperty) {
        abstractDataComponentType = createObservableProperty((SweObservableProperty) sosSimpleType);
    } else if (sosSimpleType instanceof SweQuantity) {
        abstractDataComponentType = createQuantity((SweQuantity) sosSimpleType);
    } else if (sosSimpleType instanceof SweQuantityRange) {
        abstractDataComponentType = createQuantityRange((SweQuantityRange) sosSimpleType);
    } else if (sosSimpleType instanceof SweText) {
        abstractDataComponentType = createText((SweText) sosSimpleType);
    } else if (sosSimpleType instanceof SweTimeRange) {
        abstractDataComponentType = createTimeRange((SweTimeRange) sosSimpleType);
    } else if (sosSimpleType instanceof SweTime) {
        abstractDataComponentType = createTime((SweTime) sosSimpleType);
    } else {
        throw new NotYetSupportedEncodingException(SweAbstractSimpleType.class.getSimpleName(), sosSimpleType);
    }
    addAbstractDataComponentValues(abstractDataComponentType, sosSimpleType);
    return abstractDataComponentType;
}
Also used : SweQuantity(org.n52.shetland.ogc.swe.simpleType.SweQuantity) AbstractDataComponentType(net.opengis.swe.x101.AbstractDataComponentType) SweText(org.n52.shetland.ogc.swe.simpleType.SweText) SweTime(org.n52.shetland.ogc.swe.simpleType.SweTime) NotYetSupportedEncodingException(org.n52.svalbard.encode.exception.NotYetSupportedEncodingException) SweQuantityRange(org.n52.shetland.ogc.swe.simpleType.SweQuantityRange) SweCountRange(org.n52.shetland.ogc.swe.simpleType.SweCountRange) SweCategory(org.n52.shetland.ogc.swe.simpleType.SweCategory) SweCount(org.n52.shetland.ogc.swe.simpleType.SweCount) SweTimeRange(org.n52.shetland.ogc.swe.simpleType.SweTimeRange) SweBoolean(org.n52.shetland.ogc.swe.simpleType.SweBoolean) SweObservableProperty(org.n52.shetland.ogc.swe.simpleType.SweObservableProperty)

Aggregations

SweObservableProperty (org.n52.shetland.ogc.swe.simpleType.SweObservableProperty)6 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)3 Test (org.junit.Test)2 SweDataRecord (org.n52.shetland.ogc.swe.SweDataRecord)2 SweField (org.n52.shetland.ogc.swe.SweField)2 SweTime (org.n52.shetland.ogc.swe.simpleType.SweTime)2 SweTimeRange (org.n52.shetland.ogc.swe.simpleType.SweTimeRange)2 NotYetSupportedEncodingException (org.n52.svalbard.encode.exception.NotYetSupportedEncodingException)2 SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)1 ArrayList (java.util.ArrayList)1 AbstractDataComponentType (net.opengis.swe.x101.AbstractDataComponentType)1 DataRecordDocument (net.opengis.swe.x101.DataRecordDocument)1 DataRecordType (net.opengis.swe.x101.DataRecordType)1 SimpleDataRecordType (net.opengis.swe.x101.SimpleDataRecordType)1 XmlObject (org.apache.xmlbeans.XmlObject)1 TimePeriod (org.n52.shetland.ogc.gml.time.TimePeriod)1 NilTemplateValue (org.n52.shetland.ogc.om.values.NilTemplateValue)1 SweAbstractDataComponent (org.n52.shetland.ogc.swe.SweAbstractDataComponent)1 SweCoordinate (org.n52.shetland.ogc.swe.SweCoordinate)1 SweDataArray (org.n52.shetland.ogc.swe.SweDataArray)1