Package nl.vpro.jackson2.rs
Class JsonIdAdderBodyReader
- java.lang.Object
-
- nl.vpro.jackson2.rs.JsonIdAdderBodyReader
-
- All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<java.lang.Object>
@Provider @Consumes("application/json") public class JsonIdAdderBodyReader extends java.lang.Object implements javax.ws.rs.ext.MessageBodyReader<java.lang.Object>Sometimes resteasy will not unmarshal an json because there is no type information, but the prototype actually specifies it fully. The message body reader will deal with that, by adding the id implicetely (if it is missing) before the actual unmarshal.- Since:
- 2.7
- Author:
- Michiel Meeuwissen
-
-
Constructor Summary
Constructors Constructor Description JsonIdAdderBodyReader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisReadable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)java.lang.ObjectreadFrom(java.lang.Class<java.lang.Object> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> httpHeaders, java.io.InputStream entityStream)
-
-
-
Method Detail
-
isReadable
public boolean isReadable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)- Specified by:
isReadablein interfacejavax.ws.rs.ext.MessageBodyReader<java.lang.Object>
-
readFrom
public java.lang.Object readFrom(java.lang.Class<java.lang.Object> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> httpHeaders, java.io.InputStream entityStream) throws javax.ws.rs.WebApplicationException, java.io.IOException- Specified by:
readFromin interfacejavax.ws.rs.ext.MessageBodyReader<java.lang.Object>- Throws:
javax.ws.rs.WebApplicationExceptionjava.io.IOException
-
-