am implementing a generator to generate code using Apache Velocity.
The question is that you use the JClassType.getMetaData () to get the
annotations in the code. Some extraction of my code:
    GearsDataStoreGenerator extends Generator{
                  public String generate (TreeLogger logger,
GeneratorContext context, String typeName)  throws
UnableToCompleteException
     {    TypeOracle typeOracle = context.getTypeOracle();
         JClassType requestedClass = typeOracle.getType(typeName);
         requestedClass.getMetaData(ANNOTATION_TABLE); // GWT 1.7
returns the annotation metadata! GWT 2.0 returns nothing!
        ....
So GWT 1.7 version works perfect. But from version 2.0 stopped
working. Reading the sources of the method I detected the following
change:
GWT 2.0
@Deprecated
  public final String[][] getMetaData(String tagName) {
    return TypeOracle.NO_STRING_ARR_ARR;
  }
GWT 1.7
public abstract String[][] getMetaData(String tagName);
In the context help of the method, talks about how to replace it:
...
@deprecated
Javadoc comment metadata has been deprecated in favor of proper Java
annotations. See HasAnnotations.getAnnotation(Class) for equivalent
functionality.
Someone could help me with some example of
HasAnnotations.getAnnotation
(Class) ??
It think I have to use @Target(ElementType.ANNOTATION_TYPE)?

--

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