From 815ff5d5dff6f6f4203848a36fe139bdb399bf72 Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 25 Jul 2006 15:24:12 +0000 Subject: [PATCH] pipeline changes: implemented stringify. --- weaver/src/org/aspectj/weaver/AnnotationAJ.java | 12 +++++++++++- .../org/aspectj/weaver/AnnotationNameValuePair.java | 9 +++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/weaver/src/org/aspectj/weaver/AnnotationAJ.java b/weaver/src/org/aspectj/weaver/AnnotationAJ.java index aed97377c..58fce4992 100644 --- a/weaver/src/org/aspectj/weaver/AnnotationAJ.java +++ b/weaver/src/org/aspectj/weaver/AnnotationAJ.java @@ -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) { diff --git a/weaver/src/org/aspectj/weaver/AnnotationNameValuePair.java b/weaver/src/org/aspectj/weaver/AnnotationNameValuePair.java index 3f2e61b1d..3ab561b6a 100644 --- a/weaver/src/org/aspectj/weaver/AnnotationNameValuePair.java +++ b/weaver/src/org/aspectj/weaver/AnnotationNameValuePair.java @@ -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(); + } } -- 2.39.5