]> source.dussan.org Git - aspectj.git/commitdiff
Added more information on source signature (for ajdoc)
authormkersten <mkersten>
Mon, 29 Mar 2004 22:35:35 +0000 (22:35 +0000)
committermkersten <mkersten>
Mon, 29 Mar 2004 22:35:35 +0000 (22:35 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java

index 674877a37e05b7747e50e8efe376b8385b2e9dc4..8434d1e82b8451f8530e31e25715164ca92125f4 100644 (file)
@@ -429,7 +429,11 @@ public class AsmHierarchyBuilder extends ASTVisitor {
                        makeLocation(constructorDeclaration),
                        constructorDeclaration.modifiers,
                        "",
-                       new ArrayList());       
+                       new ArrayList());  
+               
+               peNode.setModifiers(constructorDeclaration.modifiers);
+               peNode.setSourceSignature(genSourceSignature(constructorDeclaration));
+               
                ((IProgramElement)stack.peek()).addChild(peNode);
                stack.push(peNode);
                return true;    
@@ -437,6 +441,26 @@ public class AsmHierarchyBuilder extends ASTVisitor {
        public void endVisit(ConstructorDeclaration constructorDeclaration, ClassScope scope) {
                stack.pop();
        }
+       private String genSourceSignature(ConstructorDeclaration constructorDeclaration) {
+               StringBuffer output = new StringBuffer();
+               constructorDeclaration.printModifiers(constructorDeclaration.modifiers, output);
+               output.append(constructorDeclaration.selector).append('(');  
+               if (constructorDeclaration.arguments != null) {
+                       for (int i = 0; i < constructorDeclaration.arguments.length; i++) {
+                               if (i > 0) output.append(", "); //$NON-NLS-1$
+                               constructorDeclaration.arguments[i].print(0, output);
+                       }
+               }
+               output.append(')');
+               if (constructorDeclaration.thrownExceptions != null) {
+                       output.append(" throws "); //$NON-NLS-1$
+                       for (int i = 0; i < constructorDeclaration.thrownExceptions.length; i++) {
+                               if (i > 0) output.append(", "); //$NON-NLS-1$
+                               constructorDeclaration.thrownExceptions[i].print(0, output);
+                       }
+               }
+               return output.toString();
+       }
 
 //     public boolean visit(Clinit clinit, ClassScope scope) {
 //             ProgramElementNode peNode = new ProgramElementNode(