IntervalOfTimeDeserializer extends StdDeserializer<IntervalOfTime> { @Override public IntervalOfTime deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { JsonToken t = jp.getCurrentToken(); if (t == JsonToken.VALUE_STRING) { String str = jp.getText().trim(); if (str.length() == 0) { return null; } return IntervalOfTimeFormat.parse(str); } throw ctxt.mappingException(getValueClass()); } IntervalOfTimeDeserializer(); @Override IntervalOfTime deserialize(JsonParser jp, DeserializationContext ctxt);  }
@Test public void testDeserialize() throws Exception { assertThat(jsonMapper.readValue("\"19750723000000.000..19750729235959.999\"", IntervalOfTime.class), equalTo(ivl)); }