PsiElementVisitor (@NotNull DependenciesBuilder.DependencyProcessor processor, @NotNull DependencyVisitorFactory.VisitorOptions options) { GroovyElementVisitor visitor = new MyVisitor(processor, options); return new PsiElementVisitor() { @Override public void visitFile(@NotNull PsiFile file) { if (file instanceof GroovyFile) { ((GroovyFile)file).accept(visitor); } } }; }