diff options
author | aclement <aclement> | 2005-03-10 17:25:09 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-03-10 17:25:09 +0000 |
commit | f5c983b57d4bfd467cb7c45de7eea4a4adf88c61 (patch) | |
tree | 44fb6afa35bbc1eb64b941443a149ed08e728709 /org.aspectj.ajdt.core | |
parent | 463910b2bab2a9e325c2fbf33edc3db741e13452 (diff) | |
download | aspectj-f5c983b57d4bfd467cb7c45de7eea4a4adf88c61.tar.gz aspectj-f5c983b57d4bfd467cb7c45de7eea4a4adf88c61.zip |
DeclareAnnotation: formatting code for declare annotation nodes.
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java index 5a765c0e0..33716d45a 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java @@ -28,6 +28,7 @@ import org.aspectj.weaver.AdviceKind; import org.aspectj.weaver.ResolvedTypeX; import org.aspectj.weaver.TypeX; import org.aspectj.weaver.patterns.AndPointcut; +import org.aspectj.weaver.patterns.DeclareAnnotation; import org.aspectj.weaver.patterns.DeclareErrorOrWarning; import org.aspectj.weaver.patterns.DeclareParents; import org.aspectj.weaver.patterns.DeclarePrecedence; @@ -159,7 +160,20 @@ public class AsmElementFormatter { node.setName(name + DECLARE_PRECEDENCE); node.setDetails(genPrecedenceListLabel(ds.getPatterns())); - + } else if (declare.declareDecl instanceof DeclareAnnotation) { + DeclareAnnotation deca = (DeclareAnnotation)declare.declareDecl; + node.setName(name + deca.getKind()); + if (deca.getKind()==DeclareAnnotation.AT_CONSTRUCTOR) { + node.setKind(IProgramElement.Kind.DECLARE_ANNOTATION_AT_CONSTRUCTOR); + } else if (deca.getKind()==DeclareAnnotation.AT_FIELD) { + node.setKind(IProgramElement.Kind.DECLARE_ANNOTATION_AT_FIELD); + } else if (deca.getKind()==DeclareAnnotation.AT_METHOD) { + node.setKind(IProgramElement.Kind.DECLARE_ANNOTATION_AT_METHOD); + } else if (deca.getKind()==DeclareAnnotation.AT_TYPE) { + node.setKind(IProgramElement.Kind.DECLARE_ANNOTATION_AT_TYPE); + } + node.setDetails(genDecaLabel(deca)); + } else { node.setKind(IProgramElement.Kind.ERROR); node.setName(DECLARE_UNKNONWN); @@ -209,6 +223,13 @@ public class AsmElementFormatter { } } + private String genDecaLabel(DeclareAnnotation deca) { + StringBuffer sb = new StringBuffer(""); + sb.append(deca.getPatternAsString()); + sb.append(" : "); + sb.append(deca.getAnnotationString()); + return sb.toString(); + } private String genPrecedenceListLabel(TypePatternList list) { String tpList = ""; |