For what i know GWT has no support for reflection... i think you may get the
class name from the getClass() method.

On Fri, Jul 17, 2009 at 8:24 PM, Gianluigi <dava...@yahoo.it> wrote:

>
>
>
> Hi to all, it's first time that i try to use annotation in client side gwt
> application, i tried to compile that code:
>
> @Target( { ElementType.TYPE })
> @Retention(RetentionPolicy.RUNTIME)
> @interface MyAnn {
>    String value() default "";
> }
>
> @MyAnn(value="foo1")
> class B {}
>
> public class MyAnnotation {
>
>    public MyAnnotation() {}
>
>    public static final void foo() {
>
>        B b = new B();
>
>    MyAnn ann = b.getClass().getAnnotation(MyAnn.class);
>    GWT.log("" + b.getClass().isAnnotationPresent(MyAnn.class), null);
>
>    }
> }
>
> but when the GWT compiler reach getAnnotation OR isAnnotationPresent say to
> me an error like this:
>
> [ERROR] Line 31: The method isAnnotationPresent(Class<MyAnn>) is undefined
> for the type Class<capture#1-of ? extends B>
>
> What's wrong with my code? thanks for any hint
> Gian
>
>
>
>
> >
>


-- 
Quer aprender a programar? acompanhe: http://tcninja.blogspot.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to