users@jersey.java.net

[Jersey] Re: [Jersey 1.6] [JDK 1.6] Is there any other way to publish a class as a REST service without annotating the class.

From: Paul <nibin.cse_at_gmail.com>
Date: Fri, 13 May 2011 02:26:12 -0700 (PDT)

Hi Martin,

Thanks for the response. I see that this is a good solution. Still I would
need to generate that wrapper class at runtime which requires some Byte code
manipulation library right?

Is it not possible to create AbstractResource from a class which is not
annotated in Jersey? Some implementation which creates the AbstractResource
from a non annotated class and some data, that I could use instead of the
IntrospectionModeller?

But when I read through the code, I see that AbstractResource is again using
Annotations.

Methods like:

public boolean isAnnotationPresent(Class<? extends Annotation> a)
public <T extends Annotation> T getAnnotation(Class<T> a)
public Annotation[] getAnnotations()
public Annotation[] getDeclaredAnnotations()

needs annotation support in the class from which AbstractResource is
created.

Even if I extend AbstractResource to override these methods, I think it is
not possible in Java to create Annotation objects from data I have. Or is it
possible? What do you think?

Thanks,
Paul



--
View this message in context: http://jersey.576304.n2.nabble.com/Jersey-1-6-JDK-1-6-Is-there-any-other-way-to-publish-a-class-as-a-REST-service-without-annotating-th-tp6358570p6358709.html
Sent from the Jersey mailing list archive at Nabble.com.