Search in sources :

Example 1 with AbstractDataComponent

use of org.geotoolkit.swe.xml.AbstractDataComponent in project geotoolkit by Geomatys.

the class Field method getScalar.

/**
 * Return an SWE object.
 *
 * @param version The SOS version of the object (and so the SWE version).
 * @return
 */
public AnyScalar getScalar(final String version) {
    final AbstractDataComponent compo;
    if (FieldType.QUANTITY.equals(type)) {
        final UomProperty uomCode = buildUomProperty(version, uom, null);
        compo = buildQuantity(version, description, uomCode, null);
    } else if (FieldType.TEXT.equals(type)) {
        compo = buildText(version, description, null);
    } else if (FieldType.TIME.equals(type)) {
        compo = buildTime(version, description, null);
    } else if (FieldType.BOOLEAN.equals(type)) {
        compo = buildBoolean(version, description, null);
    } else {
        throw new IllegalArgumentException("Unexpected field Type:" + type);
    }
    return buildAnyScalar(version, null, name, compo);
}
Also used : AbstractDataComponent(org.geotoolkit.swe.xml.AbstractDataComponent) UomProperty(org.geotoolkit.swe.xml.UomProperty)

Aggregations

AbstractDataComponent (org.geotoolkit.swe.xml.AbstractDataComponent)1 UomProperty (org.geotoolkit.swe.xml.UomProperty)1