dev@jsr311.java.net

Re: JSR311: MessageBodyWriter.writeTo(., Class, ....)

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Wed, 19 Mar 2008 08:29:49 -0700

On Mar 19, 2008, at 4:25 AM, Stephan Koops wrote:
>
> Bill anounced in issue 36 [1] rightly, that the class is needed to
> the MessageBodyWriter. The argument is, that the returned object may
> be null. This indicates, that the type given to
> MessageBodyWriter.writeTo(., Class, ....) is the return type of the
> resource method.
> The javadoc of MessageBodyWriter.writeTo(., Class, ....) says, that
> the class of the object to be written should be given here.
> If the returned object is a subclass (or implementation) of the
> returned type, this differs.
>
Yes, I think the type should really be Class<? extends T>. If its a
subclass you should get the actual class, not necessarily T.

> Should here ever be the return type of the resource method be given?
> Than you have to conform the javadoc a little bit.
>
OK, I'll take a look at that.

Marc.

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.