Class AbstractProvider<T>
- java.lang.Object
-
- org.restlet.ext.jaxrs.internal.provider.AbstractProvider<T>
-
- Type Parameters:
T- the type that can be read and written
- All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<T>,javax.ws.rs.ext.MessageBodyWriter<T>
- Direct Known Subclasses:
AbstractJaxbProvider,ByteArrayProvider,ConverterProvider,DataSourceProvider,FileProvider,InputStreamProvider,JsonProvider,ReaderProvider,SimpleXmlProvider,SourceProvider,StringProvider,WwwFormFormProvider,WwwFormMmapProvider
@Deprecated public abstract class AbstractProvider<T> extends java.lang.Object implements javax.ws.rs.ext.MessageBodyWriter<T>, javax.ws.rs.ext.MessageBodyReader<T>Deprecated.Will be removed in next minor release.This abstract class ease the development ofMessageBodyReaders andMessageBodyWriter.- See Also:
MessageBodyReader,MessageBodyWriter
-
-
Constructor Summary
Constructors Constructor Description AbstractProvider()Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract longgetSize(T object, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)Deprecated.Returns the size of the given objects.booleanisReadable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)Deprecated.booleanisWriteable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)Deprecated.protected static java.io.IOExceptionlogAndIOExc(java.util.logging.Logger logger, java.lang.String message, java.lang.Throwable exc)Deprecated.Logs the problem and throws an IOException.abstract TreadFrom(java.lang.Class<T> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> httpResponseHeaders, java.io.InputStream entityStream)Deprecated.protected java.lang.Class<?>supportedClass()Deprecated.Returns the class object supported by this provider.abstract voidwriteTo(T object, java.lang.Class<?> type, java.lang.reflect.Type genericType, 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 entityStream)Deprecated.
-
-
-
Method Detail
-
logAndIOExc
protected static java.io.IOException logAndIOExc(java.util.logging.Logger logger, java.lang.String message, java.lang.Throwable exc) throws java.io.IOExceptionDeprecated.Logs the problem and throws an IOException.- Parameters:
logger-message-exc-- Throws:
java.io.IOException
-
getSize
public abstract long getSize(T object, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
Deprecated.Returns the size of the given objects.- Specified by:
getSizein interfacejavax.ws.rs.ext.MessageBodyWriter<T>- Parameters:
object- the object to check the size- Returns:
- the size of the object, or -1, if it is not direct readable from the object.
- See Also:
MessageBodyWriter.getSize(Object, Class, Type, Annotation[], MediaType)
-
isReadable
public boolean isReadable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)Deprecated.- Specified by:
isReadablein interfacejavax.ws.rs.ext.MessageBodyReader<T>
-
isWriteable
public boolean isWriteable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)Deprecated.- Specified by:
isWriteablein interfacejavax.ws.rs.ext.MessageBodyWriter<T>
-
readFrom
public abstract T readFrom(java.lang.Class<T> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> httpResponseHeaders, java.io.InputStream entityStream) throws java.io.IOException
Deprecated.- Specified by:
readFromin interfacejavax.ws.rs.ext.MessageBodyReader<T>- Parameters:
genericType- The genericTypeto convert to.annotations- the annotations of the artefact to convert to- Throws:
java.io.IOException- See Also:
javax.ws.rs.ext.MessageBodyReader#readFrom(java.lang.Class, javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap, java.io.InputStream)
-
supportedClass
protected java.lang.Class<?> supportedClass()
Deprecated.Returns the class object supported by this provider.- Returns:
- the class object supported by this provider.
-
writeTo
public abstract void writeTo(T object, java.lang.Class<?> type, java.lang.reflect.Type genericType, 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 entityStream) throws java.io.IOException
Deprecated.- Specified by:
writeToin interfacejavax.ws.rs.ext.MessageBodyWriter<T>- Throws:
java.io.IOException- See Also:
MessageBodyWriter.writeTo(Object, Class, Type, Annotation[], MediaType, MultivaluedMap, OutputStream)
-
-