dev@jsr311.java.net

Re: JSR311: TypeLiteral

From: Dhanji R. Prasanna <dhanji_at_gmail.com>
Date: Wed, 4 Jun 2008 21:45:51 +1000

That's a bean property, the getList() method is not a bean property getter,
rather it is an @Get HTTP responder. There are potential dangers in
reflecting on method return types, but I am not arguing one way or another.
Dhanji.

On Wed, Jun 4, 2008 at 8:56 PM, Stephan Koops <Stephan.Koops_at_web.de> wrote:

> Hi,
>
> public Response<List<Bean>> getList() { ... }
>>>
>>>
> In this example, it is not possible to determine the parameterized type
> of the returned object via reflection due to type erasure. You *can*
> actually do it by inspecting the method signature, but this is a somewhat
> unreliable workaround.
>
> How should the generic type be detected for
> public List<Bean> getList() {...}
> without reflecting the method?
>
> BTW: the javadoc of the MessageBodyWriter uses as example a field to write.
> Can you give a use case for this?
>
> best regards
> Stephan
>