use of com.fasterxml.jackson.datatype.guava.GuavaModule in project dropwizard by dropwizard.
the class GuavaExtrasModuleTest method setUp.
@Before
public void setUp() throws Exception {
mapper.registerModule(new GuavaModule());
mapper.registerModule(new GuavaExtrasModule());
}
use of com.fasterxml.jackson.datatype.guava.GuavaModule 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.guava.GuavaModule in project ds3_autogen by SpectraLogic.
the class Ds3NameMapperParserImpl method initDs3NameMapper.
private static ObjectMapper initDs3NameMapper() {
final ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerModule(new GuavaModule());
return objectMapper;
}
use of com.fasterxml.jackson.datatype.guava.GuavaModule 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.guava.GuavaModule 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