Apache CXF API

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

java.lang.Object
  extended by org.apache.cxf.jaxrs.provider.AbstractConfigurableProvider
      extended by org.apache.cxf.jaxrs.provider.SourceProvider<T>
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<T>, javax.ws.rs.ext.MessageBodyWriter<T>

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


Constructor Summary
SourceProvider()
           
 
Method Summary
protected  MessageContext getContext()
           
protected  String getPreferredSource()
           
protected  XMLStreamReader getReader(InputStream is)
           
protected  XMLStreamReader getReaderFromMessage()
           
protected  InputStream getRealStream(InputStream is)
           
 long getSize(T source, 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> source, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType m, javax.ws.rs.core.MultivaluedMap<String,String> headers, InputStream is)
           
 void writeTo(T source, Class<?> clazz, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mt, javax.ws.rs.core.MultivaluedMap<String,Object> headers, OutputStream os)
           
 
Methods inherited from class org.apache.cxf.jaxrs.provider.AbstractConfigurableProvider
getBus, getConsumeMediaTypes, getEnableBuffering, getEnableStreaming, getProduceMediaTypes, init, isPayloadEmpty, setBus, setConsumeMediaTypes, setEnableBuffering, setEnableStreaming, setProduceMediaTypes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceProvider

public SourceProvider()
Method Detail

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>

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> source,
                  Type genericType,
                  Annotation[] annotations,
                  javax.ws.rs.core.MediaType m,
                  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

getReader

protected XMLStreamReader getReader(InputStream is)

getRealStream

protected InputStream getRealStream(InputStream is)
                             throws IOException
Throws:
IOException

getReaderFromMessage

protected XMLStreamReader getReaderFromMessage()

writeTo

public void writeTo(T source,
                    Class<?> clazz,
                    Type genericType,
                    Annotation[] annotations,
                    javax.ws.rs.core.MediaType mt,
                    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

getSize

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

getPreferredSource

protected String getPreferredSource()

getContext

protected MessageContext getContext()

Apache CXF API

Apache CXF