use of org.n52.shetland.ogc.om.values.TextValue in project arctic-sea by 52North.
the class InsertResultTemplateRequestDecoder method decodeRequest.
@Override
public InsertResultTemplateRequest decodeRequest(JsonNode node) throws DecodingException {
InsertResultTemplateRequest irtr = new InsertResultTemplateRequest();
if (!node.path(JSONConstants.IDENTIFIER).isMissingNode()) {
irtr.setIdentifier(node.path(JSONConstants.IDENTIFIER).textValue());
}
irtr.setObservationTemplate(parseObservationTemplate(node));
irtr.setResultStructure(parseResultStructure(node.path(JSONConstants.RESULT_STRUCTURE)));
irtr.setResultEncoding(parseResultEncoding(node.path(JSONConstants.RESULT_ENCODING)));
return irtr;
}
use of org.n52.shetland.ogc.om.values.TextValue in project arctic-sea by 52North.
the class AbstractJSONDecoder method parseReference.
protected Reference parseReference(JsonNode node) {
Reference ref = new Reference();
ref.setHref(URI.create(node.path(AQDJSONConstants.HREF).textValue()));
ref.setActuate(node.path(AQDJSONConstants.ACTUATE).textValue());
ref.setArcrole(node.path(AQDJSONConstants.ARCROLE).textValue());
ref.setRemoteSchema(node.path(AQDJSONConstants.REMOTE_SCHEMA).textValue());
ref.setRole(node.path(AQDJSONConstants.ROLE).textValue());
ref.setShow(node.path(AQDJSONConstants.SHOW).textValue());
ref.setTitle(node.path(AQDJSONConstants.TITLE).textValue());
ref.setType(node.path(AQDJSONConstants.TYPE).textValue());
return ref;
}
use of org.n52.shetland.ogc.om.values.TextValue in project arctic-sea by 52North.
the class JSONDecoder method parseTimePeriod.
protected TimePeriod parseTimePeriod(JsonNode node) throws DateTimeParseException {
if (node.isArray()) {
ArrayNode array = (ArrayNode) node;
String startTime = array.get(0).textValue();
String endTime = array.get(1).textValue();
DateTime start = parseDateTime(startTime);
DateTime end = parseDateTime(endTime);
return new TimePeriod(start, end);
} else {
return null;
}
}
use of org.n52.shetland.ogc.om.values.TextValue in project arctic-sea by 52North.
the class TextObservationDecodingTest method testObservation.
@Test
public void testObservation() {
assertThat(observation, is(notNullValue()));
final String type = observation.getObservationConstellation().getObservationType();
assertThat(type, is(equalTo(OmConstants.OBS_TYPE_TEXT_OBSERVATION)));
final ObservationValue<?> value = observation.getValue();
assertThat(value, is(instanceOf(SingleObservationValue.class)));
assertThat(value.getPhenomenonTime(), is(instanceOf(TimeInstant.class)));
TimeInstant pt = (TimeInstant) value.getPhenomenonTime();
assertThat(pt.getValue(), is(equalTo(phenomenonTime)));
assertThat(value.getValue(), is(instanceOf(TextValue.class)));
TextValue v = (TextValue) value.getValue();
assertThat(v.getValue(), is(equalTo("Some Value")));
assertThat(v.getUnit(), is(nullValue()));
}
use of org.n52.shetland.ogc.om.values.TextValue in project arctic-sea by 52North.
the class ODataFesParserTest method testContains.
@Test
public void testContains() throws DecodingException {
Filter<?> filter = parser.decode("contains(textValue,'as%df')");
assertThat(filter, is(instanceOf(ComparisonFilter.class)));
ComparisonFilter cf = (ComparisonFilter) filter;
errors.checkThat(cf.getOperator(), is(ComparisonOperator.PropertyIsLike));
errors.checkThat(cf.getValue(), is("%as%df%"));
errors.checkThat(cf.getValueReference(), is("om:result"));
}
Aggregations