Package io.codemodder.javaparser
Interface CachingJavaParser
public interface CachingJavaParser
Responsible for parsing Java files and maintaining the compilation units across different
accesses.
-
Method Summary
Modifier and TypeMethodDescriptionstatic CachingJavaParserfrom(com.github.javaparser.JavaParser parser) Return a simple implementation of theCachingJavaParserinterface.com.github.javaparser.ast.CompilationUnitparseJavaFile(Path file) Return theCompilationUnitfor the given Java file.
-
Method Details
-
parseJavaFile
Return theCompilationUnitfor the given Java file. If the given file has not been seen before, it will be cached and all future invocations will return the sameCompilationUnit.- Parameters:
file- a Java file path- Returns:
- a
CompilationUnitfor the given file - Throws:
IOException- if there is a file I/O error
-
from
Return a simple implementation of theCachingJavaParserinterface.
-