Hi all,

I'm thinking about writing a simple forms generator using annotations.
 Here's an example of a form class

public class MyForm {

    @EmailField(label="E-mail", required=true)
    private String email ;  // or public String email -- I don't
really care about that

    @PhoneField(label="Phone")
    private String phone;
}

And then I'm thinking a generator could produce a FormPanel of some
kind from this class.  My questions is how to get at the annotations
on these fields.

1- If I use private fields, can I access these fields somehow through
JType  (or do they need to be public)
2- Can I get a List of all of the annotations on a Field?  I may have
more than one.

Looking at this method:

http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/core/ext/typeinfo/JField.html#getAnnotation(java.lang.Class)

I can get a reference to annotation providing that I know what type
I'm looking for, but it may not be convenient to assume I know which
class(es) of annotation(s) to retrieve within my generator, especially
since annotations can't inherit from each other.

Thanks,

-Dave

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to