org.jboss.resteasy.plugins.providers.jackson
Class ResteasyJacksonProvider

java.lang.Object
  extended by org.codehaus.jackson.jaxrs.JacksonJsonProvider
      extended by org.jboss.resteasy.plugins.providers.jackson.ResteasyJacksonProvider
All Implemented Interfaces:
MessageBodyReader<java.lang.Object>, MessageBodyWriter<java.lang.Object>

@Provider
public class ResteasyJacksonProvider
extends org.codehaus.jackson.jaxrs.JacksonJsonProvider

Only different from Jackson one is *+json in @Produces/@Consumes

Version:
$Revision: 1 $
Author:
Bill Burke

Field Summary
 
Fields inherited from class org.codehaus.jackson.jaxrs.JacksonJsonProvider
_cfgCheckCanDeserialize, _cfgCheckCanSerialize, _cfgCustomUntouchables, _jsonpFunctionName, _mapperConfig, _providers, _unreadableClasses, _untouchables, _unwritableClasses, BASIC_ANNOTATIONS
 
Constructor Summary
ResteasyJacksonProvider()
           
 
Method Summary
 boolean isReadable(java.lang.Class<?> aClass, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations, MediaType mediaType)
          Ascertain if the MessageBodyReader can produce an instance of a particular type.
 boolean isWriteable(java.lang.Class<?> aClass, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations, MediaType mediaType)
          Ascertain if the MessageBodyWriter supports a particular type.
 
Methods inherited from class org.codehaus.jackson.jaxrs.JacksonJsonProvider
_containedIn, _convertType, addUntouchable, checkCanDeserialize, checkCanSerialize, configure, configure, configure, configure, disable, disable, disable, disable, enable, enable, enable, enable, getSize, isJsonType, locateMapper, readFrom, setAnnotationsToUse, setJSONPFunctionName, setMapper, writeTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResteasyJacksonProvider

public ResteasyJacksonProvider()
Method Detail

isReadable

public boolean isReadable(java.lang.Class<?> aClass,
                          java.lang.reflect.Type type,
                          java.lang.annotation.Annotation[] annotations,
                          MediaType mediaType)
Description copied from interface: MessageBodyReader
Ascertain if the MessageBodyReader can produce an instance of a particular type. The type parameter gives the class of the object that should be produced, the genericType parameter gives the java.lang.reflect.Type of the object that should be produced. E.g. if the object to be produced is List, the type parameter will be java.util.List and the genericType parameter will be java.lang.reflect.ParameterizedType.

Specified by:
isReadable in interface MessageBodyReader<java.lang.Object>
Overrides:
isReadable in class org.codehaus.jackson.jaxrs.JacksonJsonProvider
Parameters:
aClass - the class of object to be produced.
type - the type of object to be produced. E.g. if the message body is to be converted into a method parameter, this will be the formal type of the method parameter as returned by Method.getGenericParameterTypes.
annotations - an array of the annotations on the declaration of the artifact that will be initialized with the produced instance. E.g. if the message body is to be converted into a method parameter, this will be the annotations on that parameter returned by Method.getParameterAnnotations.
mediaType - the media type of the HTTP entity, if one is not specified in the request then application/octet-stream is used.
Returns:
true if the type is supported, otherwise false.

isWriteable

public boolean isWriteable(java.lang.Class<?> aClass,
                           java.lang.reflect.Type type,
                           java.lang.annotation.Annotation[] annotations,
                           MediaType mediaType)
Description copied from interface: MessageBodyWriter
Ascertain if the MessageBodyWriter supports a particular type.

Specified by:
isWriteable in interface MessageBodyWriter<java.lang.Object>
Overrides:
isWriteable in class org.codehaus.jackson.jaxrs.JacksonJsonProvider
Parameters:
aClass - the class of object that is to be written.
type - the type of object to be written, obtained either by reflection of a resource method return type or via inspection of the returned instance. GenericEntity provides a way to specify this information at runtime.
annotations - an array of the annotations on the resource method that returns the object.
mediaType - the media type of the HTTP entity.
Returns:
true if the type is supported, otherwise false.


Copyright © 2010. All Rights Reserved.