From: aclement Date: Mon, 25 Feb 2008 21:26:01 +0000 (+0000) Subject: annoValMatch: able to ask annotation about its values and their settings X-Git-Tag: V1_6_0M2~34 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4cb79c2713f8c039d89419d4441de5895f304e95;p=aspectj.git annoValMatch: able to ask annotation about its values and their settings --- diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/Annotation.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/Annotation.java index 4b609fd06..ac81ec805 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/Annotation.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/Annotation.java @@ -30,6 +30,7 @@ import org.aspectj.apache.bcel.classfile.Utility; */ public class Annotation { private int typeIndex; + // OPTIMIZE don't need a new list instance for every annotation instance! private List /* ElementNameValuePair */ evs = new ArrayList(); private ConstantPool cpool; private boolean isRuntimeVisible; @@ -127,4 +128,28 @@ public class Annotation { } return result.toString(); } + + /** + * Return true if the annotation has a value with the specified name (n) and value (v) + */ + public boolean hasNameValuePair(String n, String v) { + for (int i=0;i