@WithAnnotations bug?
by Kristoffer Sjögren
Hi
Extensions that observe using @WithAnnotations are not notified with
implementing classes for annotated interfaces.
Not sure if this is intended - the javadoc seems pretty clear on that the
following example should work.
@Path("/service")
public interface Service {
@POST
public void execute();
}
public ServiceEndpoint implements Service {
public void execute() { ... }
}
public class JaxrsExtension implements Extension {
<X> void storeJaxrsResourceClasses(@Observes @WithAnnotations({Path.class,
Provider.class}) ProcessAnnotatedType<X> pat) {
AnnotatedType<X> type = pat.getAnnotatedType();
if (!type.getJavaClass().isInterface()) {
// want to manage the ServiceEndpoint here
}
}
}
Cheers,
-Kristoffer
10 years, 9 months