Tuesday, October 28, 2014

Re: Custom Annotation and Generator

So I have done a little bit of digging in the source. And it seems that this is not supported!

In GWT there is a class/method: 
Annotations.isAnnotationPresent()

However it does not check for meta annotations:

In Spring annotations are checked as follows
http://goo.gl/oYVhvm

Is this a feature that could make it into GWT???






On Tuesday, 28 October 2014 17:02:18 UTC, Juan Pablo Gardella wrote:
Oh, sorry yes for generators.

On 28 October 2014 13:49, Seamus McMorrow <seamusm...@gmail.com> wrote:
Is reflection not supported in the context of generators though?

On Tuesday, 28 October 2014 16:35:22 UTC, Juan Pablo Gardella wrote:
GWT doesn't full support the reflection API. See http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsCompatibility.html

On 28 October 2014 13:29, Seamus McMorrow <seamusm...@gmail.com> wrote:
Say I have a custom annotation that looks like the following:

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Component                                          
public @interface MyComponent {
String value() default "";
}

A class that is annotated as follows:

@MyComponent 
  private static class TestClass {
  }

And in the generator I am trying to find if the TestClass has the annotation @Component

if(clazz.isAnnotationPresent(Component.class))
   return clazz.getAnnotation(Component.class);

However this doesn't work in GWT.

The question is should this work???? 
Or do I have to create an abstract class and use @inheritance for this to work??? 


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment