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; }
private Time createTime(final SweTime time) throws OwsExceptionReport { final Time xbTime = Time.Factory.newInstance(XmlOptionsHelper.getInstance().getXmlOptions()); if (time.isSetValue()) { final XmlDateTime xbDateTime = createDateTime(time.getValue()); xbTime.setValue(xbDateTime); } if (time.isSetUom()) { if (time.getUom().startsWith("urn:") || time.getUom().startsWith("http://")) { xbTime.addNewUom().setHref(time.getUom()); } else { xbTime.addNewUom().setCode(time.getUom()); } } if (time.isSetQuality()) { xbTime.setQuality(createQuality(time.getQuality())[0]); } if (time.isSetContstraint()) { createConstraint(xbTime.addNewConstraint(), time.getConstraint()); } return xbTime; }