ccc.api.jaxrs.providers
Class S11nProvider<T>

java.lang.Object
  extended by ccc.api.jaxrs.providers.AbstractProvider
      extended by ccc.api.jaxrs.providers.S11nProvider<T>
Type Parameters:
T - The type of object this provider will read write.
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<T>, javax.ws.rs.ext.MessageBodyWriter<T>

@Provider
public class S11nProvider<T>
extends AbstractProvider
implements javax.ws.rs.ext.MessageBodyWriter<T>, javax.ws.rs.ext.MessageBodyReader<T>

A JAX-RS provider for objects with serializers.

Author:
Civic Computing Ltd.

Constructor Summary
S11nProvider()
           
 
Method Summary
 long getSize(T object, java.lang.Class<?> clazz, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
          
 boolean isReadable(java.lang.Class<?> clazz, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
          
 boolean isWriteable(java.lang.Class<?> clazz, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
          
 T readFrom(java.lang.Class<T> clazz, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mimetype, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> httpHeaders, java.io.InputStream is)
          
 void writeTo(T object, java.lang.Class<?> clazz, java.lang.reflect.Type type, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> httpHeaders, java.io.OutputStream outputStream)
          
 
Methods inherited from class ccc.api.jaxrs.providers.AbstractProvider
createWriter, getTypeArgument, isCollectionOfType, isMapOfType, readJson, readString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

S11nProvider

public S11nProvider()
Method Detail

getSize

public long getSize(T object,
                    java.lang.Class<?> clazz,
                    java.lang.reflect.Type type,
                    java.lang.annotation.Annotation[] annotations,
                    javax.ws.rs.core.MediaType mediaType)

Specified by:
getSize in interface javax.ws.rs.ext.MessageBodyWriter<T>

isWriteable

public boolean isWriteable(java.lang.Class<?> clazz,
                           java.lang.reflect.Type type,
                           java.lang.annotation.Annotation[] annotations,
                           javax.ws.rs.core.MediaType mediaType)

Specified by:
isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<T>

writeTo

public void writeTo(T object,
                    java.lang.Class<?> clazz,
                    java.lang.reflect.Type type,
                    java.lang.annotation.Annotation[] annotations,
                    javax.ws.rs.core.MediaType mediaType,
                    javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> httpHeaders,
                    java.io.OutputStream outputStream)

Specified by:
writeTo in interface javax.ws.rs.ext.MessageBodyWriter<T>

isReadable

public boolean isReadable(java.lang.Class<?> clazz,
                          java.lang.reflect.Type type,
                          java.lang.annotation.Annotation[] annotations,
                          javax.ws.rs.core.MediaType mediaType)

Specified by:
isReadable in interface javax.ws.rs.ext.MessageBodyReader<T>

readFrom

public T readFrom(java.lang.Class<T> clazz,
                  java.lang.reflect.Type type,
                  java.lang.annotation.Annotation[] annotations,
                  javax.ws.rs.core.MediaType mimetype,
                  javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> httpHeaders,
                  java.io.InputStream is)
           throws java.io.IOException

Specified by:
readFrom in interface javax.ws.rs.ext.MessageBodyReader<T>
Throws:
java.io.IOException


Copyright © 2010. All Rights Reserved.