Make additional information available to isReadable, isWritable and getSize methods svn path=/trunk/; revision=476
diff --git a/src/jsr311-api/src/javax/ws/rs/ext/MessageBodyReader.java b/src/jsr311-api/src/javax/ws/rs/ext/MessageBodyReader.java index 0fee43b..cca0961 100644 --- a/src/jsr311-api/src/javax/ws/rs/ext/MessageBodyReader.java +++ b/src/jsr311-api/src/javax/ws/rs/ext/MessageBodyReader.java
@@ -54,9 +54,11 @@ * message body is to be converted into a method parameter, this will be * the annotations on that parameter returned by * <code>Class.getParameterAnnotations</code>. + * @param mediaType the media type of the HTTP entity. * @return true if the type is supported, otherwise false. */ - boolean isReadable(Class<?> type, Type genericType, Annotation annotations[]); + boolean isReadable(Class<?> type, Type genericType, + Annotation annotations[], MediaType mediaType); /** * Read a type from the {@link InputStream}.
diff --git a/src/jsr311-api/src/javax/ws/rs/ext/MessageBodyWriter.java b/src/jsr311-api/src/javax/ws/rs/ext/MessageBodyWriter.java index 18483b8..758f49a 100644 --- a/src/jsr311-api/src/javax/ws/rs/ext/MessageBodyWriter.java +++ b/src/jsr311-api/src/javax/ws/rs/ext/MessageBodyWriter.java
@@ -52,19 +52,30 @@ * provides a way to specify this information at runtime. * @param annotations an array of the annotations on the resource * method that returns the object. + * @param mediaType the media type of the HTTP entity. * @return true if the type is supported, otherwise false. */ - boolean isWriteable(Class<?> type, Type genericType, Annotation annotations[]); + boolean isWriteable(Class<?> type, Type genericType, + Annotation annotations[], MediaType mediaType); /** * Called before <code>writeTo</code> to ascertain the length in bytes of * the serialized form of <code>t</code>. A non-negative return value is * used in a HTTP <code>Content-Length</code> header. * @param t the instance to write + * @param type the class of object that is to be written. + * @param 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. {@link javax.ws.rs.core.GenericEntity} + * provides a way to specify this information at runtime. + * @param annotations an array of the annotations on the resource + * method that returns the object. + * @param mediaType the media type of the HTTP entity. * @return length in bytes or -1 if the length cannot be determined in * advance */ - long getSize(T t); + long getSize(T t, Class<?> type, Type genericType, Annotation annotations[], + MediaType mediaType); /** * Write a type to an HTTP response. The response header map is mutable