users@jsr311.java.net

Re: Annotations on interfaces and super classes

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Wed, 11 Jun 2008 12:21:01 -0400

On Jun 11, 2008, at 12:09 PM, Stephan Koops wrote:

> While discussing about that, a question comes in my mind.
> Example:
>
> public class A {
> @GET
> public Object get() {...}
> }
>
> @Path("whatever")
> public class B extends A{
> @PUT
> public Object put() {...}
> }
>
> Does the root resource class B supports GET?
>
Yes. In terms of the reflection API, use Class.getMethods rather than
Class.getDeclaredMethods.

Marc.

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