Пример #1
0
 @Override
 public CustomMap deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
   CustomMap result = new CustomMap();
   result.put("x", jp.getText());
   return result;
 }
Пример #2
0
 /** Simple test to ensure that @JsonDeserialize.using is recognized */
 public void testMapWithDeserializer() throws IOException {
   ObjectMapper mapper = new ObjectMapper();
   CustomMap result = mapper.readValue(quote("xyz"), CustomMap.class);
   assertEquals(1, result.size());
   assertEquals("xyz", result.get("x"));
 }