Example usage for org.springframework.data.rest.webmvc.json Jackson2DatatypeHelper configureObjectMapper

List of usage examples for org.springframework.data.rest.webmvc.json Jackson2DatatypeHelper configureObjectMapper

Introduction

In this page you can find the example usage for org.springframework.data.rest.webmvc.json Jackson2DatatypeHelper configureObjectMapper.

Prototype

public static void configureObjectMapper(ObjectMapper mapper) 

Source Link

Usage

From source file:org.springframework.data.rest.webmvc.config.RepositoryRestMvcConfiguration.java

protected ObjectMapper basicObjectMapper() {

    ObjectMapper objectMapper = new ObjectMapper();

    objectMapper.configure(SerializationFeature.INDENT_OUTPUT, true);
    objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
    objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
    objectMapper.registerModule(geoModule);

    if (config().isEnableEnumTranslation()) {
        objectMapper.registerModule(new JacksonSerializers(enumTranslator()));
    }/* w  ww.j a v a2 s .  com*/

    Jackson2DatatypeHelper.configureObjectMapper(objectMapper);
    // Configure custom Modules
    configurerDelegate.configureJacksonObjectMapper(objectMapper);
    configureJacksonObjectMapper(objectMapper);

    return objectMapper;
}