Java 类com.intellij.psi.impl.source.JavaLightStubBuilder 实例源码

项目:consulo-java    文件:ContractInferenceIndexKt.java   
@NotNull
private static Map<Integer, MethodData> indexFile(LighterAST tree)
{
    Map<Integer, MethodData> result = new HashMap<>();

    new RecursiveLighterASTNodeWalkingVisitor(tree)
    {
        int methodIndex;

        @Override
        public void visitNode(@NotNull LighterASTNode element)
        {
            if(element.getTokenType() == JavaElementType.METHOD)
            {
                MethodData methodData = calcData(tree, element);
                if(methodData != null)
                {
                    result.put(methodIndex, methodData);
                }

                methodIndex++;
            }

            if(JavaLightStubBuilder.isCodeBlockWithoutStubs(element))
            {
                return;
            }

            super.visitNode(element);
        }
    }.visitNode(tree.getRoot());
    return result;
}