Example usage for org.springframework.data.rest.webmvc RestMediaTypes ALPS_JSON

List of usage examples for org.springframework.data.rest.webmvc RestMediaTypes ALPS_JSON

Introduction

In this page you can find the example usage for org.springframework.data.rest.webmvc RestMediaTypes ALPS_JSON.

Prototype

MediaType ALPS_JSON

To view the source code for org.springframework.data.rest.webmvc RestMediaTypes ALPS_JSON.

Click Source Link

Usage

From source file:org.springframework.data.rest.webmvc.alps.AlpsJsonHttpMessageConverter.java

/**
 * Creates a new {@link AlpsJsonHttpMessageConverter} for the given {@link Converter}.
 * //w  ww . j ava2 s.c o  m
 * @param converter must not be {@literal null}.
 */
public AlpsJsonHttpMessageConverter(RootResourceInformationToAlpsDescriptorConverter converter) {

    Assert.notNull(converter, "Converter must not be null!");

    this.converter = converter;

    ObjectMapper mapper = getObjectMapper();
    mapper.setSerializationInclusion(Include.NON_EMPTY);

    setPrettyPrint(true);
    setSupportedMediaTypes(Arrays.asList(RestMediaTypes.ALPS_JSON, MediaType.APPLICATION_JSON, MediaType.ALL));
}