]> source.dussan.org Git - aspectj.git/commitdiff
Declare annotation: added getAnnotation/addAnnotation to the RTX hierarchy
authoraclement <aclement>
Thu, 10 Mar 2005 17:44:58 +0000 (17:44 +0000)
committeraclement <aclement>
Thu, 10 Mar 2005 17:44:58 +0000 (17:44 +0000)
weaver/src/org/aspectj/weaver/ResolvedTypeX.java

index 1214df7d0167e4fe58a037d98073b892d06ef35e..865ceb81beac100b748675027ba4942c4f9ed429 100644 (file)
@@ -529,6 +529,21 @@ public abstract class ResolvedTypeX extends TypeX implements AnnotatedElement {
        return false;
     }
     
+    /**
+     * Note: Only overridden by Name subtype
+     */
+       public void addAnnotation(AnnotationX annotationX) {
+               throw new RuntimeException("ResolvedTypeX.addAnnotation() should never be called");
+       }
+       
+       /**
+        * Note: Only overridden by Name subtype
+        */
+       public AnnotationX[] getAnnotations() {
+               throw new RuntimeException("ResolvedTypeX.getAnnotations() should never be called");
+       }
+
+    
     /**
      * Note: Only overridden by Name subtype.
      */
@@ -626,6 +641,13 @@ public abstract class ResolvedTypeX extends TypeX implements AnnotatedElement {
                return delegate.isClass();
            }
 
+           public AnnotationX[] getAnnotations() {
+               return delegate.getAnnotations();
+           }
+           
+           public void addAnnotation(AnnotationX annotationX) {
+               delegate.addAnnotation(annotationX);
+           }
            public boolean hasAnnotation(TypeX ofType) {
                return delegate.hasAnnotation(ofType);
            }
@@ -789,7 +811,8 @@ public abstract class ResolvedTypeX extends TypeX implements AnnotatedElement {
             this.exposedToWeaver = exposedToWeaver;
         }
                
-           public final boolean isClass() {
+
+               public final boolean isClass() {
                return !isAspect() && !isInterface();
            }
            
@@ -799,6 +822,8 @@ public abstract class ResolvedTypeX extends TypeX implements AnnotatedElement {
            public abstract boolean isAnnotation();
            public abstract boolean isAnnotationWithRuntimeRetention();
            
+           public abstract AnnotationX[] getAnnotations();
+               public abstract void addAnnotation(AnnotationX annotationX);
            public abstract boolean hasAnnotation(TypeX ofType);
            public abstract ResolvedTypeX[] getAnnotationTypes();