use of org.n52.shetland.ogc.om.NamedValue in project arctic-sea by 52North.
the class WmlObservationProcessDecoderv20Test method getTextNamedValue.
private NamedValue<String> getTextNamedValue() {
NamedValue<String> nv = new NamedValue<String>();
nv.setName(getNameValueOfferingName());
nv.setValue(new TextValue(TEXT_OFFERING));
return nv;
}
use of org.n52.shetland.ogc.om.NamedValue in project arctic-sea by 52North.
the class WmlObservationProcessDecoderv20Test method getReferencedNamedValue.
private NamedValue<ReferenceType> getReferencedNamedValue() {
NamedValue<ReferenceType> nv = new NamedValue<ReferenceType>();
nv.setName(getNameValueOfferingName());
nv.setValue(new ReferenceValue(new ReferenceType(REF_OFFERING)));
return nv;
}
use of org.n52.shetland.ogc.om.NamedValue in project arctic-sea by 52North.
the class AbstractOmV20XmlStreamWriter method writeMetadata.
/**
* Write extension information
*
* @param map
* Map with values
* @param element
* element name
* @throws XMLStreamException
* If an error occurs when writing to stream
* @throws EncodingException
* If an error occurs when creating elements to be written
*/
protected void writeMetadata(Map<String, NamedValue<?>> map, QName element) throws XMLStreamException, EncodingException {
for (Entry<String, NamedValue<?>> entry : map.entrySet()) {
Object o = getEncoder(OmConstants.NS_OM_2, entry.getValue()).encode(entry.getValue(), EncodingContext.of(XmlBeansEncodingFlags.DOCUMENT));
if (o != null && o instanceof XmlObject) {
start(GetDataAvailabilityConstants.GDA_EXTENSION);
attr("name", entry.getKey());
rawText(((XmlObject) o).xmlText(getXmlOptions()));
end(GetDataAvailabilityConstants.GDA_EXTENSION);
}
}
}
use of org.n52.shetland.ogc.om.NamedValue in project arctic-sea by 52North.
the class AbstractOmV20XmlStreamWriter method writeParameter.
/**
* Write om:parameter to stream
*
* @throws XMLStreamException
* If an error occurs when writing to stream
* @throws EncodingException
* If an error occurs when creating elements to be written
*/
protected void writeParameter() throws XMLStreamException, EncodingException {
XmlEncoderKey key = new XmlEncoderKey(OmConstants.NS_OM_2, NamedValue.class);
Encoder<XmlObject, NamedValue<?>> encoder = getEncoder(key);
if (encoder != null) {
for (NamedValue<?> namedValue : getElement().getParameter()) {
start(OmConstants.QN_OM_20_PARAMETER);
writeXmlObject(encoder.encode(namedValue), OmConstants.QN_OM_20_NAMED_VALUE);
end(OmConstants.QN_OM_20_PARAMETER);
}
}
}
use of org.n52.shetland.ogc.om.NamedValue in project arctic-sea by 52North.
the class ObservationDecoder method parseNamedValue.
private NamedValue<?> parseNamedValue(JsonNode parameter) throws DecodingException {
JsonNode namedValue = parameter.path(JSONConstants.NAMED_VALUE);
NamedValue<?> nv = parseNamedValueValue(namedValue.path(JSONConstants.VALUE));
ReferenceType referenceType = new ReferenceType(namedValue.path(JSONConstants.NAME).asText());
nv.setName(referenceType);
return nv;
}
Aggregations