[jboss-cvs] jbossretro/src/main/org/jboss/ant/tasks/retro ...

David Lloyd david.lloyd at jboss.com
Tue Oct 31 09:11:55 EST 2006


  User: dlloyd  
  Date: 06/10/31 09:11:55

  Modified:    src/main/org/jboss/ant/tasks/retro  ClassRedirectEditor.java
  Log:
  Add getDeclaredAnnotations methods... incidentally, the difference is that getAnnotations is supposed to list inherited annotations, whereas getDeclaredAnnotations is not; as far as I can ascertain, the jbossretro version of getAnnotations is behaving as getDeclaredAnnotations is supposed to.  Therefore I just copied getAnnotations to getDeclaredAnnotations, but as a second stage to this, getAnnotations probably should be enhanced to recursively search base types.
  
  Revision  Changes    Path
  1.20      +18 -1     jbossretro/src/main/org/jboss/ant/tasks/retro/ClassRedirectEditor.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ClassRedirectEditor.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbossretro/src/main/org/jboss/ant/tasks/retro/ClassRedirectEditor.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -b -r1.19 -r1.20
  --- ClassRedirectEditor.java	15 Oct 2006 05:31:22 -0000	1.19
  +++ ClassRedirectEditor.java	31 Oct 2006 14:11:55 -0000	1.20
  @@ -52,7 +52,7 @@
    * 
    * @author <a href="adrian at jboss.com">Adrian Brock</a>
    * @author Scott.Stark at jboss.org
  - * @version $Revision: 1.19 $
  + * @version $Revision: 1.20 $
    */
   public class ClassRedirectEditor extends ExprEditor
   {
  @@ -195,6 +195,9 @@
            // clazz.getAnnotations() -> AnnotationHelper.getAnnotations(clazz)
            else if ("getAnnotations".equals(callName))
               call.replace("$_ = " + ANNOTATION_HELPER + ".getAnnotations($0);");
  +         // clazz.getDeclaredAnnotations() -> AnnotationHelper.getDeclaredAnnotations(clazz)
  +         else if ("getDeclaredAnnotations".equals(callName))
  +            call.replace("$_ = " + ANNOTATION_HELPER + ".getDeclaredAnnotations($0);");
            // clazz.cast(o) -> ClassRedirects.cast(clazz, o)
            else if ("cast".equals(callName))
               call.replace("$_ = " + CLASS_REDIRECTS + ".cast($0, $1);");
  @@ -222,6 +225,10 @@
            // method.getAnnotations() -> AnnotationHelper.getAnnotation(method)
            else if ("getAnnotations".equals(callName))
               call.replace("$_ = " + ANNOTATION_HELPER + ".getAnnotations($0);");
  +         // method.getDeclaredAnnotations() -> AnnotationHelper.getDeclaredAnnotations(method)
  +         else if ("getDeclaredAnnotations".equals(callName))
  +            call.replace("$_ = " + ANNOTATION_HELPER + ".getDeclaredAnnotations($0);");
  +         // method.getParameterAnnotations() -> AnnotationHelper.getParameterAnnotations(method)
            else if ("getParameterAnnotations".equals(callName))
               call.replace("$_ = " + ANNOTATION_HELPER + ".getParameterAnnotations($0);");
         }
  @@ -236,6 +243,10 @@
            // constructor.getAnnotations() -> AnnotationHelper.getAnnotation(constructor)
            else if ("getAnnotations".equals(callName))
               call.replace("$_ = " + ANNOTATION_HELPER + ".getAnnotations($0);");
  +         // constructor.getDeclaredAnnotations() -> AnnotationHelper.getDeclaredAnnotation(constructor)
  +         else if ("getDeclaredAnnotations".equals(callName))
  +            call.replace("$_ = " + ANNOTATION_HELPER + ".getDeclaredAnnotations($0);");
  +         // constructor.getParameterAnnotations() -> AnnotationHelper.getParameterAnnotations(constructor)
            else if ("getParameterAnnotations".equals(callName))
               call.replace("$_ = " + ANNOTATION_HELPER + ".getParameterAnnotations($0);");
         }
  @@ -250,6 +261,9 @@
            // field.getAnnotations() -> AnnotationHelper.getAnnotation(field)
            else if ("getAnnotations".equals(callName))
               call.replace("$_ = " + ANNOTATION_HELPER + ".getAnnotations($0);");
  +         // field.getDeclaredAnnotations() -> AnnotationHelper.getDeclaredAnnotation(field)
  +         else if ("getDeclaredAnnotations".equals(callName))
  +            call.replace("$_ = " + ANNOTATION_HELPER + ".getDeclaredAnnotations($0);");
         }
         else if (ACCESSIBLE_OBJECT.equals(className))
         {
  @@ -262,6 +276,9 @@
            // ao.getAnnotations() -> AnnotationHelper.getAnnotation(field)
            else if ("getAnnotations".equals(callName))
               call.replace("$_ = " + ANNOTATION_HELPER + ".getAnnotations($0);");
  +         // ao.getDeclaredAnnotations() -> AnnotationHelper.getDeclaredAnnotation(field)
  +         else if ("getDeclaredAnnotations".equals(callName))
  +            call.replace("$_ = " + ANNOTATION_HELPER + ".getDeclaredAnnotations($0);");
         }
         else if (STRING.equals(className))
         {
  
  
  



More information about the jboss-cvs-commits mailing list