org.apache.clerezza.triaxrs.providers.provided
Class DataSourceProvider

java.lang.Object
  extended by org.apache.clerezza.triaxrs.providers.provided.DataSourceProvider
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<DataSource>, javax.ws.rs.ext.MessageBodyWriter<DataSource>

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


Nested Class Summary
static class DataSourceProvider.ByteArrayDataSource
           
 
Constructor Summary
DataSourceProvider()
           
 
Method Summary
 long getSize(DataSource t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
           
 boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
           
 boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
           
 DataSource readFrom(Class<DataSource> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders, InputStream entityStream)
           
 void writeTo(DataSource t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSourceProvider

public DataSourceProvider()
Method Detail

isReadable

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

readFrom

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

getSize

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

isWriteable

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

writeTo

public void writeTo(DataSource t,
                    Class<?> type,
                    Type genericType,
                    Annotation[] annotations,
                    javax.ws.rs.core.MediaType mediaType,
                    javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders,
                    OutputStream entityStream)
             throws IOException,
                    javax.ws.rs.WebApplicationException
Specified by:
writeTo in interface javax.ws.rs.ext.MessageBodyWriter<DataSource>
Throws:
IOException
javax.ws.rs.WebApplicationException


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