users@jsr311.java.net

Re: JSR311: WebAppExc subclasses? and: generic type for MessageBodyWriters

From: Bill Burke <bburke_at_redhat.com>
Date: Thu, 05 Jun 2008 16:50:31 -0400

Marc Hadley wrote:
> @GET
> Response get() {...}
>

Why not templatize Response?

@GET
Response<List<String>> get() {...}

I just had to do this exact thing so that RESTEasy's Client-side
framework could get type information from a response.

An interesting thing about this approach is that you can do the same
hacks that Bob Lee's TypeLiteral. The code also looks a lot nicer and
less hacky then the TypeLiteral example you gave on the dev list.

Bill

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com