Search in sources :

Example 66 with ASTVisitor

use of org.eclipse.jdt.core.dom.ASTVisitor in project sts4 by spring-projects.

the class WebfluxRouterSymbolProvider method getSymbolsForRouterFunction.

private Collection<EnhancedSymbolInformation> getSymbolsForRouterFunction(MethodDeclaration methodDeclaration, TextDocument doc) {
    List<EnhancedSymbolInformation> result = new ArrayList<>();
    Block body = methodDeclaration.getBody();
    body.accept(new ASTVisitor() {

        @Override
        public boolean visit(MethodInvocation node) {
            IMethodBinding methodBinding = node.resolveMethodBinding();
            if (WebfluxUtils.isRouteMethodInvocation(methodBinding)) {
                extractMappingSymbol(node, doc, result);
            }
            return super.visit(node);
        }
    });
    return result;
}
Also used : IMethodBinding(org.eclipse.jdt.core.dom.IMethodBinding) ArrayList(java.util.ArrayList) Block(org.eclipse.jdt.core.dom.Block) MethodInvocation(org.eclipse.jdt.core.dom.MethodInvocation) EnhancedSymbolInformation(org.springframework.ide.vscode.boot.java.handlers.EnhancedSymbolInformation) ASTVisitor(org.eclipse.jdt.core.dom.ASTVisitor)

Aggregations

ASTVisitor (org.eclipse.jdt.core.dom.ASTVisitor)66 ArrayList (java.util.ArrayList)27 ASTNode (org.eclipse.jdt.core.dom.ASTNode)20 SimpleName (org.eclipse.jdt.core.dom.SimpleName)20 CompilationUnit (org.eclipse.jdt.core.dom.CompilationUnit)18 ICompilationUnit (org.eclipse.jdt.core.ICompilationUnit)15 List (java.util.List)14 MethodDeclaration (org.eclipse.jdt.core.dom.MethodDeclaration)14 SingleVariableDeclaration (org.eclipse.jdt.core.dom.SingleVariableDeclaration)12 TypeDeclaration (org.eclipse.jdt.core.dom.TypeDeclaration)12 VariableDeclarationStatement (org.eclipse.jdt.core.dom.VariableDeclarationStatement)12 ASTParser (org.eclipse.jdt.core.dom.ASTParser)11 Block (org.eclipse.jdt.core.dom.Block)10 Expression (org.eclipse.jdt.core.dom.Expression)10 ImportDeclaration (org.eclipse.jdt.core.dom.ImportDeclaration)10 Name (org.eclipse.jdt.core.dom.Name)10 Statement (org.eclipse.jdt.core.dom.Statement)10 MethodInvocation (org.eclipse.jdt.core.dom.MethodInvocation)9 SearchResult (com.liferay.blade.api.SearchResult)8 FieldDeclaration (org.eclipse.jdt.core.dom.FieldDeclaration)8