@Override public <T> T deserialize(String type, ContentType contentType, String json) { if (VOID.equals(type) || json == null || json.isEmpty()) { return null; } ObjectMapper<T> mapper = jacksonMapperProvider.getMapper(type); try { return mapper.read(json, getDeserializationContext().build()); } catch (JsonMappingException e) { throw new SerializationException("Unable to deserialize response. An unexpected error occurred.", e); } }
@Inject JsonSerialization(JacksonMapperProvider jacksonMapperProvider) { this.jacksonMapperProvider = jacksonMapperProvider; deserializationContext = JsonDeserializationContext.builder() .failOnUnknownProperties(false); serializationContext = JsonSerializationContext.builder(); }
protected JsonDeserializationContext newDefaultDeserializationContext() { return JsonDeserializationContext.builder().build(); }
/** {@inheritDoc} */ @Override public T read( String in ) throws JsonDeserializationException { return read( in, JsonDeserializationContext.builder().build() ); }