com.tangosol.coherence.management.internal.MapProvider Maven / Gradle / Ivy
/*
* Copyright (c) 2000, 2022, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* https://oss.oracle.com/licenses/upl.
*/
package com.tangosol.coherence.management.internal;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.tangosol.net.management.MapJsonBodyHandler;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.MultivaluedMap;
import jakarta.ws.rs.ext.MessageBodyReader;
import jakarta.ws.rs.ext.MessageBodyWriter;
import jakarta.ws.rs.ext.Provider;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* A {@link MessageBodyWriter} and {@link MessageBodyReader} for {@link Map}
* or {@link LinkedHashMap}.
*
* When converting json to a {@link Map} this class will produce instances
* of {@link LinkedHashMap}.
*
* @author jk 2019.05.31
*/
@Provider
@Produces({MediaType.APPLICATION_JSON})
@Consumes({MediaType.APPLICATION_JSON})
public class MapProvider
implements MessageBodyWriter