Search in sources :

Example 21 with SweField

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

the class FieldEncoder method encodeSweCategoryField.

private ObjectNode encodeSweCategoryField(SweField field) {
    ObjectNode jfield = createField(field);
    jfield.put(JSONConstants.TYPE, JSONConstants.CATEGORY_TYPE);
    SweCategory sweCategory = (SweCategory) field.getElement();
    jfield.put(JSONConstants.CODESPACE, sweCategory.getCodeSpace());
    if (sweCategory.isSetValue()) {
        jfield.put(JSONConstants.VALUE, sweCategory.getValue());
    }
    return jfield;
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) SweCategory(org.n52.shetland.ogc.swe.simpleType.SweCategory)

Example 22 with SweField

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

the class FieldEncoder method encodeSweCountField.

private ObjectNode encodeSweCountField(SweField field) {
    ObjectNode jfield = createField(field);
    jfield.put(JSONConstants.TYPE, JSONConstants.COUNT_TYPE);
    SweCount sweCount = (SweCount) field.getElement();
    if (sweCount.isSetValue()) {
        jfield.put(JSONConstants.VALUE, sweCount.getValue());
    }
    return jfield;
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) SweCount(org.n52.shetland.ogc.swe.simpleType.SweCount)

Example 23 with SweField

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

the class FieldEncoder method encodeSweTimeField.

private ObjectNode encodeSweTimeField(SweField field) {
    ObjectNode jfield = createField(field);
    jfield.put(JSONConstants.TYPE, JSONConstants.TIME_TYPE);
    SweTime sweTime = (SweTime) field.getElement();
    jfield.put(JSONConstants.UOM, sweTime.getUom());
    if (sweTime.isSetValue()) {
        jfield.put(JSONConstants.VALUE, DateTimeHelper.formatDateTime2IsoString(sweTime.getValue()));
    }
    return jfield;
}
Also used : SweTime(org.n52.shetland.ogc.swe.simpleType.SweTime) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode)

Example 24 with SweField

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

the class FieldEncoder method encodeSweBooleanField.

private ObjectNode encodeSweBooleanField(SweField field) {
    ObjectNode jfield = createField(field);
    jfield.put(JSONConstants.TYPE, JSONConstants.BOOLEAN_TYPE);
    SweBoolean sweBoolean = (SweBoolean) field.getElement();
    if (sweBoolean.isSetValue()) {
        jfield.put(JSONConstants.VALUE, sweBoolean.getValue());
    }
    return jfield;
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) SweBoolean(org.n52.shetland.ogc.swe.simpleType.SweBoolean)

Example 25 with SweField

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

the class FieldEncoder method encodeSweQuantityField.

private ObjectNode encodeSweQuantityField(SweField field) {
    ObjectNode jfield = createField(field);
    jfield.put(JSONConstants.TYPE, JSONConstants.QUANTITY_TYPE);
    SweQuantity sweQuantity = (SweQuantity) field.getElement();
    if (sweQuantity.isSetValue()) {
        jfield.put(JSONConstants.VALUE, sweQuantity.getValue());
    }
    jfield.put(JSONConstants.UOM, sweQuantity.getUom());
    return jfield;
}
Also used : SweQuantity(org.n52.shetland.ogc.swe.simpleType.SweQuantity) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode)

Aggregations

SweField (org.n52.shetland.ogc.swe.SweField)59 Test (org.junit.Test)42 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)34 XmlObject (org.apache.xmlbeans.XmlObject)20 SimpleDataRecordType (net.opengis.swe.x101.SimpleDataRecordType)19 SweDataRecord (org.n52.shetland.ogc.swe.SweDataRecord)19 SweBoolean (org.n52.shetland.ogc.swe.simpleType.SweBoolean)12 SweTime (org.n52.shetland.ogc.swe.simpleType.SweTime)12 AnyScalarPropertyType (net.opengis.swe.x101.AnyScalarPropertyType)11 SweQuantity (org.n52.shetland.ogc.swe.simpleType.SweQuantity)11 SweText (org.n52.shetland.ogc.swe.simpleType.SweText)11 SweAbstractDataComponent (org.n52.shetland.ogc.swe.SweAbstractDataComponent)10 SweSimpleDataRecord (org.n52.shetland.ogc.swe.SweSimpleDataRecord)10 DataComponentPropertyType (net.opengis.swe.x101.DataComponentPropertyType)9 DataRecordType (net.opengis.swe.x101.DataRecordType)9 SweCategory (org.n52.shetland.ogc.swe.simpleType.SweCategory)9 SweCount (org.n52.shetland.ogc.swe.simpleType.SweCount)9 SweTimeRange (org.n52.shetland.ogc.swe.simpleType.SweTimeRange)8 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)7 DateTime (org.joda.time.DateTime)4