Class MapProvider
java.lang.Object
com.tangosol.coherence.management.internal.MapProvider
- All Implemented Interfaces:
jakarta.ws.rs.ext.MessageBodyReader<Map<?,,?>> jakarta.ws.rs.ext.MessageBodyWriter<Map<?,?>>
@Provider
@Produces("application/json")
@Consumes("application/json")
public class MapProvider
extends Object
implements jakarta.ws.rs.ext.MessageBodyWriter<Map<?,?>>, jakarta.ws.rs.ext.MessageBodyReader<Map<?,?>>
A
MessageBodyWriter and MessageBodyReader for Map
or LinkedHashMap.
When converting json to a Map this class will produce instances
of LinkedHashMap.
- Author:
- jk 2019.05.31
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetSize(Map<?, ?> map, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) booleanisReadable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) booleanisWriteable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) Map<?, ?> readFrom(Class<Map<?, ?>> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, String> httpHeaders, InputStream entityStream) voidwriteTo(Map<?, ?> map, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream)
-
Constructor Details
-
MapProvider
public MapProvider()
-
-
Method Details
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) - Specified by:
isWriteablein interfacejakarta.ws.rs.ext.MessageBodyWriter<Map<?,?>>
-
getSize
public long getSize(Map<?, ?> map, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) - Specified by:
getSizein interfacejakarta.ws.rs.ext.MessageBodyWriter<Map<?,?>>
-
writeTo
public void writeTo(Map<?, ?> map, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, throws IOException, jakarta.ws.rs.WebApplicationExceptionObject> httpHeaders, OutputStream entityStream) - Specified by:
writeToin interfacejakarta.ws.rs.ext.MessageBodyWriter<Map<?,?>> - Throws:
IOExceptionjakarta.ws.rs.WebApplicationException
-
isReadable
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) - Specified by:
isReadablein interfacejakarta.ws.rs.ext.MessageBodyReader<Map<?,?>>
-
readFrom
public Map<?,?> readFrom(Class<Map<?, ?>> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, throws IOException, jakarta.ws.rs.WebApplicationExceptionString> httpHeaders, InputStream entityStream) - Specified by:
readFromin interfacejakarta.ws.rs.ext.MessageBodyReader<Map<?,?>> - Throws:
IOExceptionjakarta.ws.rs.WebApplicationException
-