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;
}
Aggregations