Package org.eclipse.jdt.internal.compiler.ast

Examples of org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.traverse()


        root.setEntity(new SourceCodeEntity(methodName, JavaEntityType.METHOD, new SourceRange(
                method.declarationSourceStart,
                method.declarationSourceEnd)));
        List<Comment> comments = CompilationUtils.extractComments(compilation);
        sMethodBodyConverter.initialize(root, method, comments, compilation.getScanner());
        method.traverse(sMethodBodyConverter, (ClassScope) null);
        return root;
    }

    public Node convertMethodDeclaration(String methodName, JavaCompilation compilation) {
        AbstractMethodDeclaration method = CompilationUtils.findMethod(compilation.getCompilationUnit(), methodName);
View Full Code Here


        Node root = new Node(JavaEntityType.METHOD, methodName);
        root.setEntity(new SourceCodeEntity(methodName, JavaEntityType.METHOD, new SourceRange(
                method.declarationSourceStart,
                method.declarationSourceEnd)));
        sDeclarationConverter.initialize(root, compilation.getScanner());
        method.traverse(sDeclarationConverter, (ClassScope) null);
        return root;
    }

    public Node convertFieldDeclaration(String fieldName, JavaCompilation compilation) {
      FieldDeclaration field = CompilationUtils.findField(compilation.getCompilationUnit(), fieldName);
View Full Code Here

    }

    private void convertMethod(String name) {
        createRootNode(JavaEntityType.METHOD_DECLARATION, name);
        AbstractMethodDeclaration method = CompilationUtils.findMethod(fCompilation.getCompilationUnit(), name);
        method.traverse(getDeclarationconverter(), (ClassScope) null);
    }

    private void convertClass(String name) {
        createRootNode(JavaEntityType.METHOD_DECLARATION, name);
        TypeDeclaration type = CompilationUtils.findType(fCompilation.getCompilationUnit(), name);
View Full Code Here

        sRoot = new Node(JavaEntityType.METHOD, "foo");
        sRoot.setEntity(new SourceCodeEntity("foo", JavaEntityType.METHOD, new SourceRange()));
        AbstractMethodDeclaration method = CompilationUtils.findMethod(sCompilation.getCompilationUnit(), "foo");
        JavaMethodBodyConverter bodyT = sInjector.getInstance(JavaMethodBodyConverter.class);
        bodyT.initialize(sRoot, method, sComments, sCompilation.getScanner());
        method.traverse(bodyT, (ClassScope) null);
    }

    @Test
    public void proximityRatingShouldAssociateCommentToClosestEntity() throws Exception {
        Node node = findNode("boolean check = (number > 0);");
View Full Code Here

    private void convert() {
        createRootNode(JavaEntityType.METHOD, "method");
        AbstractMethodDeclaration method = CompilationUtils.findMethod(fCompilation.getCompilationUnit(), "method");
        sMethodBodyConverter.initialize(fRoot, method, null, fCompilation.getScanner());
        method.traverse(sMethodBodyConverter, (ClassScope) null);
    }

    @Override
    protected String getSourceCodeWithSnippets(String... snippets) {
        StringBuilder src = new StringBuilder("public class Foo { ");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.