use of org.n52.shetland.util.DateTimeParseException in project arctic-sea by 52North.
the class GmlDecoderv321 method parseTimePosition.
private TimeInstant parseTimePosition(TimePositionType xbTimePosition) throws DecodingException {
TimeInstant ti = new TimeInstant();
String timeString = xbTimePosition.getStringValue();
if (timeString != null && !timeString.isEmpty()) {
try {
// TODO better differentiate between ISO8601 and indeterminate
// value
ti.setValue(DateTimeHelper.parseIsoString2DateTime(timeString));
ti.setRequestedTimeLength(DateTimeHelper.getTimeLengthBeforeTimeZone(timeString));
} catch (DateTimeParseException ex) {
ti.setIndeterminateValue(new IndeterminateValue(timeString));
}
}
if (xbTimePosition.isSetIndeterminatePosition()) {
ti.setIndeterminateValue(new IndeterminateValue(xbTimePosition.getIndeterminatePosition().toString()));
}
return ti;
}
Aggregations