]> source.dussan.org Git - aspectj.git/commitdiff
annotation removal program element support
authoraclement <aclement>
Thu, 25 Nov 2010 21:46:31 +0000 (21:46 +0000)
committeraclement <aclement>
Thu, 25 Nov 2010 21:46:31 +0000 (21:46 +0000)
asm/src/org/aspectj/asm/IProgramElement.java
asm/src/org/aspectj/asm/internal/HandleProviderDelimiter.java
asm/src/org/aspectj/asm/internal/ProgramElement.java

index 0413267e12ffefcd7c20461fb6b93a87926cadd9..96dedb2b20fd5b1782cc192d787658c2f6d06802 100644 (file)
@@ -433,6 +433,8 @@ public interface IProgramElement extends Serializable {
         */
        public String getAnnotationType();
 
+       public String[] getRemovedAnnotationTypes();
+
        public Map<String, List<String>> getDeclareParentsMap();
 
        public void setDeclareParentsMap(Map<String, List<String>> newmap);
@@ -440,4 +442,8 @@ public interface IProgramElement extends Serializable {
        public void addFullyQualifiedName(String fqname);
 
        public String getFullyQualifiedName();
+
+       public void setAnnotationRemover(boolean isRemover);
+
+       public boolean isAnnotationRemover();
 }
\ No newline at end of file
index 164cc23f774572478f29923e16ac92b51c18583f..9bbfc307cfe2efa971d5fb9db9631ca63babc486 100644 (file)
@@ -29,11 +29,10 @@ public class HandleProviderDelimiter {
        public static final HandleProviderDelimiter IMPORTDECLARATION = new HandleProviderDelimiter('#');
        public static final HandleProviderDelimiter COUNT = new HandleProviderDelimiter('!');
        public static final HandleProviderDelimiter ESCAPE = new HandleProviderDelimiter('\\');
+       public static final HandleProviderDelimiter PACKAGEDECLARATION = new HandleProviderDelimiter('%');
+       public static final HandleProviderDelimiter PACKAGEFRAGMENTROOT = new HandleProviderDelimiter('/');
        // these below are not currently used because no iprogramelement.kind
        // equivalent
-       public static final HandleProviderDelimiter PACKAGEFRAGMENTROOT = new HandleProviderDelimiter('/');
-       public static final HandleProviderDelimiter PACKAGEDECLARATION = new HandleProviderDelimiter('%'); // now
-       // used
        public static final HandleProviderDelimiter LOCALVARIABLE = new HandleProviderDelimiter('@');
        public static final HandleProviderDelimiter TYPE_PARAMETER = new HandleProviderDelimiter(']');
 
@@ -47,7 +46,7 @@ public class HandleProviderDelimiter {
        public static final HandleProviderDelimiter DECLARE = new HandleProviderDelimiter('`');
        public static final HandleProviderDelimiter POINTCUT = new HandleProviderDelimiter('"');
 
-       public static final HandleProviderDelimiter PHANTOM = new HandleProviderDelimiter(',');
+       public static final HandleProviderDelimiter PHANTOM = new HandleProviderDelimiter(';');
 
        private static char empty = ' ';
        private final char delim;
index f5a853a8cea981556724c1fa32b435c5ef911585..bf7eb7f4b8eb11515ebd08ac314d04b36ba070f0 100644 (file)
@@ -344,13 +344,41 @@ public class ProgramElement implements IProgramElement {
                kvpairs.put("annotationType", fullyQualifiedAnnotationType);
        }
 
-       /**
-        * {@inheritDoc}
-        */
+       public void setAnnotationRemover(boolean isRemover) {
+               fixMap();
+               kvpairs.put("annotationRemover", isRemover);
+       }
+
        public String getAnnotationType() {
+               if (isAnnotationRemover()) {
+                       return null;
+               }
                return (String) (kvpairs == null ? null : kvpairs.get("annotationType"));
        }
 
+       public boolean isAnnotationRemover() {
+               if (kvpairs == null) {
+                       return false;
+               }
+               Boolean b = (Boolean) kvpairs.get("annotationRemover");
+               if (b == null) {
+                       return false;
+               }
+               return b.booleanValue();
+       }
+
+       public String[] getRemovedAnnotationTypes() {
+               if (!isAnnotationRemover()) {
+                       return null;
+               }
+               String annotype = (String) (kvpairs == null ? null : kvpairs.get("annotationType"));
+               if (annotype == null) {
+                       return null;
+               } else {
+                       return new String[] { annotype };
+               }
+       }
+
        public String getCorrespondingType() {
                return getCorrespondingType(false);
        }