org.web3j.protocol.deserializer.RawResponseDeserializer Java Examples
The following examples show how to use
org.web3j.protocol.deserializer.RawResponseDeserializer.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ObjectMapperFactory.java From client-sdk-java with Apache License 2.0 | 6 votes |
private static ObjectMapper configureObjectMapper( ObjectMapper objectMapper, boolean shouldIncludeRawResponses) { if (shouldIncludeRawResponses) { SimpleModule module = new SimpleModule(); module.setDeserializerModifier(new BeanDeserializerModifier() { @Override public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config, BeanDescription beanDesc, JsonDeserializer<?> deserializer) { if (Response.class.isAssignableFrom(beanDesc.getBeanClass())) { return new RawResponseDeserializer(deserializer); } return deserializer; } }); objectMapper.registerModule(module); } objectMapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true); objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); return objectMapper; }
Example #2
Source File: ObjectMapperFactory.java From etherscan-explorer with GNU General Public License v3.0 | 6 votes |
private static ObjectMapper configureObjectMapper( ObjectMapper objectMapper, boolean shouldIncludeRawResponses) { if (shouldIncludeRawResponses) { SimpleModule module = new SimpleModule(); module.setDeserializerModifier(new BeanDeserializerModifier() { @Override public JsonDeserializer<?> modifyDeserializer(DeserializationConfig config, BeanDescription beanDesc, JsonDeserializer<?> deserializer) { if (Response.class.isAssignableFrom(beanDesc.getBeanClass())) { return new RawResponseDeserializer(deserializer); } return deserializer; } }); objectMapper.registerModule(module); } objectMapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true); objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); return objectMapper; }
Example #3
Source File: ObjectMapperFactory.java From web3j with Apache License 2.0 | 5 votes |
private static ObjectMapper configureObjectMapper( ObjectMapper objectMapper, boolean shouldIncludeRawResponses) { if (shouldIncludeRawResponses) { SimpleModule module = new SimpleModule(); module.setDeserializerModifier( new BeanDeserializerModifier() { @Override public JsonDeserializer<?> modifyDeserializer( DeserializationConfig config, BeanDescription beanDesc, JsonDeserializer<?> deserializer) { if (Response.class.isAssignableFrom(beanDesc.getBeanClass())) { return new RawResponseDeserializer(deserializer); } return deserializer; } }); objectMapper.registerModule(module); } objectMapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true); objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); return objectMapper; }