Class PluginJacksonMessageBodyReader
- java.lang.Object
-
- com.identityworksllc.iiq.common.plugin.PluginJacksonMessageBodyReader
-
- All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<Object>
public abstract class PluginJacksonMessageBodyReader extends Object implements javax.ws.rs.ext.MessageBodyReader<Object>
Message body reader that can be reused across plugins.As it turns out, Jersey has a hard time when more than one message body reader can read the same input. This class will allow any installed plugin’s message body reader to deserialize any plugin’s VO classes.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PluginJacksonMessageBodyReader(String packagePrefix)
Sets the package prefix
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isReadable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
Determines whether the input is readableObject
readFrom(Class<Object> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders, InputStream entityStream)
Reads the input in the context of the requested type’s classloader
-
-
-
Constructor Detail
-
PluginJacksonMessageBodyReader
protected PluginJacksonMessageBodyReader(String packagePrefix)
Sets the package prefix- Parameters:
packagePrefix
- The package prefix for your implementation
-
-
Method Detail
-
isReadable
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
Determines whether the input is readable- Specified by:
isReadable
in interfacejavax.ws.rs.ext.MessageBodyReader<Object>
- See Also:
MessageBodyReader.isReadable(Class, Type, Annotation[], MediaType)
-
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 entityStream) throws IOException, javax.ws.rs.WebApplicationException
Reads the input in the context of the requested type’s classloader- Specified by:
readFrom
in interfacejavax.ws.rs.ext.MessageBodyReader<Object>
- Throws:
IOException
javax.ws.rs.WebApplicationException
- See Also:
MessageBodyReader.readFrom(Class, Type, Annotation[], MediaType, MultivaluedMap, InputStream)
-
-