Apache CXF API

org.apache.cxf.jaxrs.provider
Class DataBindingProvider<T>

java.lang.Object
  extended by org.apache.cxf.jaxrs.provider.DataBindingProvider<T>
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<T>, javax.ws.rs.ext.MessageBodyWriter<T>
Direct Known Subclasses:
DataBindingJSONProvider

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


Constructor Summary
DataBindingProvider()
           
DataBindingProvider(DataBinding db)
           
 
Method Summary
protected  XMLStreamReader createReader(Class<?> clazz, Type genericType, InputStream is)
           
protected  XMLStreamWriter createWriter(Class<?> clazz, Type genericType, OutputStream os)
           
 long getSize(T t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mt)
           
 boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mt)
           
 boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mt)
           
 T readFrom(Class<T> clazz, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType type, javax.ws.rs.core.MultivaluedMap<String,String> headers, InputStream is)
           
 void setDataBinding(DataBinding db)
           
 void writeTo(T o, Class<?> clazz, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType type, javax.ws.rs.core.MultivaluedMap<String,Object> headers, OutputStream os)
           
protected  void writeToWriter(XMLStreamWriter writer, Object o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataBindingProvider

public DataBindingProvider()

DataBindingProvider

public DataBindingProvider(DataBinding db)
Method Detail

setDataBinding

public void setDataBinding(DataBinding db)

isReadable

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

readFrom

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

createReader

protected XMLStreamReader createReader(Class<?> clazz,
                                       Type genericType,
                                       InputStream is)
                                throws Exception
Throws:
Exception

getSize

public long getSize(T t,
                    Class<?> type,
                    Type genericType,
                    Annotation[] annotations,
                    javax.ws.rs.core.MediaType mt)
Specified by:
getSize in interface javax.ws.rs.ext.MessageBodyWriter<T>

isWriteable

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

writeTo

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

writeToWriter

protected void writeToWriter(XMLStreamWriter writer,
                             Object o)
                      throws Exception
Throws:
Exception

createWriter

protected XMLStreamWriter createWriter(Class<?> clazz,
                                       Type genericType,
                                       OutputStream os)
                                throws Exception
Throws:
Exception

Apache CXF API

Apache CXF