ccc.api.jaxrs.providers
Class JsonableWriter<T extends Jsonable2>

java.lang.Object
  extended by ccc.api.jaxrs.providers.AbstractProvider
      extended by ccc.api.jaxrs.providers.JsonableWriter<T>
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<T>, javax.ws.rs.ext.MessageBodyWriter<Jsonable>

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

A JAX-RS provider for jsonable objects.

Author:
Civic Computing Ltd.

Constructor Summary
JsonableWriter()
           
 
Method Summary
 long getSize(Jsonable 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(Jsonable 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

JsonableWriter

public JsonableWriter()
Method Detail

getSize

public long getSize(Jsonable 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<Jsonable>

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<Jsonable>

writeTo

public void writeTo(Jsonable 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<Jsonable>

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 extends Jsonable2>

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 extends Jsonable2>
Throws:
java.io.IOException


Copyright © 2010. All Rights Reserved.