]> source.dussan.org Git - aspectj.git/commitdiff
pipeline changes: implemented stringify.
authoraclement <aclement>
Tue, 25 Jul 2006 15:24:12 +0000 (15:24 +0000)
committeraclement <aclement>
Tue, 25 Jul 2006 15:24:12 +0000 (15:24 +0000)
weaver/src/org/aspectj/weaver/AnnotationAJ.java
weaver/src/org/aspectj/weaver/AnnotationNameValuePair.java

index aed97377cf0eaf731138c365cd7bbc94532e93c8..58fce499205969468321c5157c125e2281388d84 100644 (file)
@@ -54,7 +54,17 @@ public class AnnotationAJ {
        }
        
        public String stringify() {
-               return "xxxxxxxxxxx";
+               StringBuffer sb = new StringBuffer();
+               sb.append("@").append(UnresolvedType.forSignature(type).getClassName());
+               if (hasNameValuePairs()) {
+                       sb.append("(");
+                       for (Iterator iter = nvPairs.iterator(); iter.hasNext();) {
+                               AnnotationNameValuePair element = (AnnotationNameValuePair) iter.next();
+                               sb.append(element.stringify());
+                       }
+                       sb.append(")");
+               }
+               return sb.toString();
        }
 
        public String getStringValueOf(Object name) {
index 3f2e61b1d444290b4c2155043d9f2e9e5540f7ee..3ab561b6adcb2c05978e1b2a7df9fdf040cc5f61 100644 (file)
@@ -35,4 +35,13 @@ public class AnnotationNameValuePair {
                sb.append(name+"="+val.toString());
                return sb.toString();
        }
+
+       public String stringify() {
+               StringBuffer sb = new StringBuffer();
+               if (!name.equals("value")) {
+                       sb.append(name+"=");
+               }
+               sb.append(val.stringify());
+               return sb.toString();
+       }
 }