Example usage for com.fasterxml.jackson.jaxrs.cfg ObjectWriterInjector set

List of usage examples for com.fasterxml.jackson.jaxrs.cfg ObjectWriterInjector set

Introduction

In this page you can find the example usage for com.fasterxml.jackson.jaxrs.cfg ObjectWriterInjector set.

Prototype

public static void set(ObjectWriterModifier mod) 

Source Link

Usage

From source file:edu.jhuapl.dorset.rest.PrettyPrinter.java

@Override
public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)
        throws IOException {
    UriInfo uriInfo = requestContext.getUriInfo();
    MultivaluedMap<String, String> params = uriInfo.getQueryParameters();
    if (params.containsKey("pretty") && !params.getFirst("pretty").equals("0")) {
        ObjectWriterInjector.set(new PrettyPrintModifier());
    }//from w  ww. j a  v a2s.  co m

}