Tuesday, October 28, 2014

Re: Custom Annotation and Generator

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-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