You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Benson Margulies <bi...@gmail.com> on 2011/12/01 17:48:45 UTC

An annotation utility I thought we would have

I'm a bit surprised that org.apache.cxf.jaxrs.utils.AnnotationUtils
does not have a method that says:

"Here's a method and an annotation. If the method has the annotation,
return it. Otherwise, go to the containing class, and it's parents, in
search of it."

Is there something I'm missing which would make this a bad idea?

Re: An annotation utility I thought we would have

Posted by Benson Margulies <bi...@gmail.com>.
Doesn't help with methods, only with classes. But that still is less
code to write than nothing at all.

On Thu, Dec 1, 2011 at 11:56 AM, Daniel Kulp <dk...@apache.org> wrote:
> On Thursday, December 01, 2011 11:48:45 AM Benson Margulies wrote:
>> I'm a bit surprised that org.apache.cxf.jaxrs.utils.AnnotationUtils
>> does not have a method that says:
>>
>> "Here's a method and an annotation. If the method has the annotation,
>> return it. Otherwise, go to the containing class, and it's parents, in
>> search of it."
>>
>> Is there something I'm missing which would make this a bad idea?
>
> Probably something useful to add to ReflectionUtil.
>
> That said, you should also ask yourself if  the annotation itself just have
> @Inherited on it and whether that would be enough or not?
>
>
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com

Re: An annotation utility I thought we would have

Posted by Benson Margulies <bi...@gmail.com>.
JAX-RS has an AnnotationUtils class that has other annotational
goodies, and there's no annotation code in ReflectionUtil, so I think
I'll follow the Alice's Restaurant principle.


On Thu, Dec 1, 2011 at 11:56 AM, Daniel Kulp <dk...@apache.org> wrote:
> On Thursday, December 01, 2011 11:48:45 AM Benson Margulies wrote:
>> I'm a bit surprised that org.apache.cxf.jaxrs.utils.AnnotationUtils
>> does not have a method that says:
>>
>> "Here's a method and an annotation. If the method has the annotation,
>> return it. Otherwise, go to the containing class, and it's parents, in
>> search of it."
>>
>> Is there something I'm missing which would make this a bad idea?
>
> Probably something useful to add to ReflectionUtil.
>
> That said, you should also ask yourself if  the annotation itself just have
> @Inherited on it and whether that would be enough or not?
>
>
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com

Re: An annotation utility I thought we would have

Posted by Daniel Kulp <dk...@apache.org>.
On Thursday, December 01, 2011 11:48:45 AM Benson Margulies wrote:
> I'm a bit surprised that org.apache.cxf.jaxrs.utils.AnnotationUtils
> does not have a method that says:
> 
> "Here's a method and an annotation. If the method has the annotation,
> return it. Otherwise, go to the containing class, and it's parents, in
> search of it."
> 
> Is there something I'm missing which would make this a bad idea?

Probably something useful to add to ReflectionUtil.

That said, you should also ask yourself if  the annotation itself just have 
@Inherited on it and whether that would be enough or not?


-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com