T - public abstract class AbstractEntityProvider<T> extends Object implements MessageBodyReader<T>, MessageBodyWriter<T>
| Constructor and Description |
|---|
AbstractEntityProvider() |
| Modifier and Type | Method and Description |
|---|---|
long |
getSize(T t,
Class<?> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType)
Called before
writeTo to ascertain the length in bytes of
the serialized form of t. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisReadable, readFromisWriteable, writeTopublic long getSize(T t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
MessageBodyWriterwriteTo to ascertain the length in bytes of
the serialized form of t. A non-negative return value is
used in a HTTP Content-Length header.getSize in interface MessageBodyWriter<T>t - the instance to writetype - the class of object that is to be written.genericType - the type of object to be written, obtained either
by reflection of a resource method return type or by inspection
of the returned instance. GenericEntity
provides a way to specify this information at runtime.annotations - an array of the annotations on the resource
method that returns the object.mediaType - the media type of the HTTP entity.Copyright © 2014. All Rights Reserved.