Package io.airlift.jaxrs
Class JsonMapper
- java.lang.Object
-
- io.airlift.jaxrs.JsonMapper
-
-
Field Summary
Fields Modifier and Type Field Description protected Loggerlogprotected com.fasterxml.jackson.databind.ObjectMapperobjectMapper
-
Constructor Summary
Constructors Constructor Description JsonMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.fasterxml.jackson.core.JsonFactorygetReaderJsonFactory()longgetSize(Object value, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)booleanisReadable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)booleanisWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)ObjectreadFrom(Class<Object> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders, InputStream inputStream)voidsetUriInfo(javax.ws.rs.core.UriInfo uriInfo)protected voidwrite(Object value, Optional<com.fasterxml.jackson.databind.JavaType> rootType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream outputStream)voidwriteTo(Object value, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream outputStream)
-
-
-
Field Detail
-
log
protected final Logger log
-
objectMapper
protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
-
Method Detail
-
setUriInfo
@Context public void setUriInfo(javax.ws.rs.core.UriInfo uriInfo)
-
getReaderJsonFactory
protected com.fasterxml.jackson.core.JsonFactory getReaderJsonFactory()
-
write
protected void write(Object value, Optional<com.fasterxml.jackson.databind.JavaType> rootType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream outputStream) throws IOException
- Throws:
IOException
-
isReadable
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
- Specified by:
isReadablein interfacejavax.ws.rs.ext.MessageBodyReader<Object>
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
- Specified by:
isWriteablein interfacejavax.ws.rs.ext.MessageBodyWriter<Object>
-
readFrom
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
- Specified by:
readFromin interfacejavax.ws.rs.ext.MessageBodyReader<Object>- Throws:
IOException
-
getSize
public long getSize(Object value, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
- Specified by:
getSizein interfacejavax.ws.rs.ext.MessageBodyWriter<Object>
-
writeTo
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
- Specified by:
writeToin interfacejavax.ws.rs.ext.MessageBodyWriter<Object>- Throws:
IOException
-
-