Search in sources :

Example 1 with Time

use of net.opengis.swe.x101.TimeDocument.Time in project arctic-sea by 52North.

the class SweCommonEncoderv101 method createTime.

private Time createTime(SweTime component) throws EncodingException {
    Time xml = Time.Factory.newInstance(getXmlOptions());
    if (component.isSetValue()) {
        XmlDateTime xbDateTime = createDateTime(component.getValue());
        xml.setValue(xbDateTime);
    }
    if (component.isSetUom()) {
        if (component.getUom().startsWith(URN) || component.getUom().startsWith(HTTP)) {
            xml.addNewUom().setHref(component.getUom());
        } else {
            xml.addNewUom().setCode(component.getUom());
        }
    }
    if (component.isSetQuality()) {
        xml.setQuality(createQuality(component.getQuality())[0]);
    }
    if (component.isSetContstraint()) {
        createConstraint(xml.getConstraint(), component.getConstraint());
    }
    return xml;
}
Also used : XmlDateTime(org.apache.xmlbeans.XmlDateTime) Time(net.opengis.swe.x101.TimeDocument.Time) XmlDateTime(org.apache.xmlbeans.XmlDateTime) SweTime(org.n52.shetland.ogc.swe.simpleType.SweTime) DateTime(org.joda.time.DateTime)

Aggregations

Time (net.opengis.swe.x101.TimeDocument.Time)1 XmlDateTime (org.apache.xmlbeans.XmlDateTime)1 DateTime (org.joda.time.DateTime)1 SweTime (org.n52.shetland.ogc.swe.simpleType.SweTime)1