users@jsr311.java.net

Re: GenericEntity

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Fri, 06 Jun 2008 15:14:38 -0400

All suggestions implemented, thanks.

Marc.

On Jun 6, 2008, at 2:47 PM, Stephan Koops wrote:

> Hi,
>> Why not templatize Response?
> that's what I wanted to say :-) But as Marc and Paul shown, it would
> not work.
>
> Until now we've had also the problem, that a resource method could
> not return objects with different generic types, dependent of
> parameters or whatever. So the solution with the GenericEntity is
> very good.
>
> Marc, I've some small remarks for the class GenericEntity:
> • Add a message to the IllegalArgumentException in the constructor,
> e.g."The entity must not be null"
> • Do you want to switch the logic in
> getSuperclassTypeParameter(Class<?> subclass), to if (!(superclass
> instanceof ParameterizedType)) ? Who knows, what will change here
> later.
> • You should update one "<String>" to "&lt;String&gt;" in the
> preformatted part of the class javadoc.
> • Perhaps it is useful to document explicit, that the subclass
> *could be* anonymus.
> • It seems useful to me to document also in the constructors
> javadoc, that the class must be subclassed. This helps to
> understand, if someone wonders, why the constructor is not visible,
> and than sees, that it is protected.
> I missed the updates on the javadoc for parameter genericType of
> MessageBodyWriter.isWriteable() and .writeTo()
>
> best regards
> Stephan

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