@Provider
@Consumes(value={"application/json","text/json"})
@Produces(value={"application/json","text/json"})
public class JsonMapper
extends Object
implements javax.ws.rs.ext.MessageBodyReader<Object>, javax.ws.rs.ext.MessageBodyWriter<Object>
| Constructor and Description |
|---|
JsonMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
| Modifier and Type | Method and Description |
|---|---|
long |
getSize(Object value,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType) |
boolean |
isReadable(Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType) |
boolean |
isWriteable(Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType) |
Object |
readFrom(Class<Object> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders,
InputStream inputStream) |
void |
setUriInfo(javax.ws.rs.core.UriInfo uriInfo) |
void |
writeTo(Object value,
Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders,
OutputStream outputStream) |
public static final Logger log
@Inject public JsonMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
@Context public void setUriInfo(javax.ws.rs.core.UriInfo uriInfo)
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
isReadable in interface javax.ws.rs.ext.MessageBodyReader<Object>public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<Object>public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders, InputStream inputStream) throws IOException
readFrom in interface javax.ws.rs.ext.MessageBodyReader<Object>IOExceptionpublic long getSize(Object value, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
getSize in interface javax.ws.rs.ext.MessageBodyWriter<Object>public void writeTo(Object value, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream outputStream) throws IOException
writeTo in interface javax.ws.rs.ext.MessageBodyWriter<Object>IOExceptionCopyright © 2010–2020 Airlift. All rights reserved.