org.apache.wink.providers.json4j
Class JSON4JObjectProvider

java.lang.Object
  extended by org.apache.wink.providers.json4j.JSON4JObjectProvider
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<JSONObject>, javax.ws.rs.ext.MessageBodyWriter<JSONObject>

@Provider
public class JSON4JObjectProvider
extends Object
implements javax.ws.rs.ext.MessageBodyWriter<JSONObject>, javax.ws.rs.ext.MessageBodyReader<JSONObject>


Constructor Summary
JSON4JObjectProvider()
           
 
Method Summary
 long getSize(JSONObject obj, Class<?> clazz, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
           
 boolean isReadable(Class<?> clazz, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
           
 boolean isWriteable(Class<?> clazz, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
           
 JSONObject readFrom(Class<JSONObject> clazz, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,String> headers, InputStream is)
           
 void writeTo(JSONObject obj, Class<?> clazz, Type type, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> headers, OutputStream os)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSON4JObjectProvider

public JSON4JObjectProvider()
Method Detail

isReadable

public boolean isReadable(Class<?> clazz,
                          Type type,
                          Annotation[] annotations,
                          javax.ws.rs.core.MediaType mediaType)
Specified by:
isReadable in interface javax.ws.rs.ext.MessageBodyReader<JSONObject>

readFrom

public JSONObject readFrom(Class<JSONObject> clazz,
                           Type type,
                           Annotation[] annotations,
                           javax.ws.rs.core.MediaType mediaType,
                           javax.ws.rs.core.MultivaluedMap<String,String> headers,
                           InputStream is)
                    throws IOException,
                           javax.ws.rs.WebApplicationException
Specified by:
readFrom in interface javax.ws.rs.ext.MessageBodyReader<JSONObject>
Throws:
IOException
javax.ws.rs.WebApplicationException

getSize

public long getSize(JSONObject obj,
                    Class<?> clazz,
                    Type type,
                    Annotation[] annotations,
                    javax.ws.rs.core.MediaType mediaType)
Specified by:
getSize in interface javax.ws.rs.ext.MessageBodyWriter<JSONObject>

isWriteable

public boolean isWriteable(Class<?> clazz,
                           Type type,
                           Annotation[] annotations,
                           javax.ws.rs.core.MediaType mediaType)
Specified by:
isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<JSONObject>

writeTo

public void writeTo(JSONObject obj,
                    Class<?> clazz,
                    Type type,
                    Annotation[] annotations,
                    javax.ws.rs.core.MediaType mediaType,
                    javax.ws.rs.core.MultivaluedMap<String,Object> headers,
                    OutputStream os)
             throws IOException,
                    javax.ws.rs.WebApplicationException
Specified by:
writeTo in interface javax.ws.rs.ext.MessageBodyWriter<JSONObject>
Throws:
IOException
javax.ws.rs.WebApplicationException


Copyright © 2009-2012 The Apache Software Foundation. All Rights Reserved.