use of com.fasterxml.jackson.datatype.jdk8.Jdk8Module in project ratpack by ratpack.
the class DefaultConfigDataBuilder method newDefaultObjectMapper.
public static ObjectMapper newDefaultObjectMapper() {
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
objectMapper.registerModule(new Jdk8Module());
objectMapper.registerModule(new GuavaModule());
objectMapper.registerModule(new JavaTimeModule());
JsonFactory factory = objectMapper.getFactory();
factory.enable(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES);
factory.enable(JsonParser.Feature.ALLOW_SINGLE_QUOTES);
return objectMapper;
}
use of com.fasterxml.jackson.datatype.jdk8.Jdk8Module in project keywhiz by square.
the class KeywhizService method customizeObjectMapper.
/**
* Customizes ObjectMapper for common settings.
*
* @param objectMapper to be customized
* @return customized input factory
*/
public static ObjectMapper customizeObjectMapper(ObjectMapper objectMapper) {
objectMapper.registerModules(new Jdk8Module());
objectMapper.registerModules(new JavaTimeModule());
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
return objectMapper;
}
use of com.fasterxml.jackson.datatype.jdk8.Jdk8Module in project keywhiz by square.
the class CliModule method generalMapper.
@Provides
public ObjectMapper generalMapper() {
/**
* Customizes ObjectMapper for common settings.
*
* @param objectMapper to be customized
* @return customized input factory
*/
ObjectMapper objectMapper = Jackson.newObjectMapper();
objectMapper.registerModule(new Jdk8Module());
objectMapper.registerModules(new JavaTimeModule());
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
return objectMapper;
}
use of com.fasterxml.jackson.datatype.jdk8.Jdk8Module in project dropwizard by dropwizard.
the class Jackson method configure.
private static ObjectMapper configure(ObjectMapper mapper) {
mapper.registerModule(new GuavaModule());
mapper.registerModule(new LogbackModule());
mapper.registerModule(new GuavaExtrasModule());
mapper.registerModule(new JodaModule());
mapper.registerModule(new AfterburnerModule());
mapper.registerModule(new FuzzyEnumModule());
mapper.registerModule(new ParameterNamesModule());
mapper.registerModules(new Jdk8Module());
mapper.registerModules(new JavaTimeModule());
mapper.setPropertyNamingStrategy(new AnnotationSensitivePropertyNamingStrategy());
mapper.setSubtypeResolver(new DiscoverableSubtypeResolver());
return mapper;
}
use of com.fasterxml.jackson.datatype.jdk8.Jdk8Module in project buck by facebook.
the class ObjectMappers method newDefaultInstance.
public static ObjectMapper newDefaultInstance() {
ObjectMapper mapper = new ObjectMapper();
// Disable automatic flush() after mapper.write() call, because it is usually unnecessary,
// and it makes BufferedOutputStreams to be useless
mapper.disable(SerializationFeature.FLUSH_AFTER_WRITE_VALUE);
// Add support for serializing Guava collections.
mapper.registerModule(new GuavaModule());
mapper.registerModule(new Jdk8Module());
return mapper;
}
Aggregations