Interface CachingJavaParser


public interface CachingJavaParser
Responsible for parsing Java files and maintaining the compilation units across different accesses.
  • Method Summary

    Modifier and Type
    Method
    Description
    from(com.github.javaparser.JavaParser parser)
    Return a simple implementation of the CachingJavaParser interface.
    com.github.javaparser.ast.CompilationUnit
    Return the CompilationUnit for the given Java file.
  • Method Details

    • parseJavaFile

      com.github.javaparser.ast.CompilationUnit parseJavaFile(Path file) throws IOException
      Return the CompilationUnit for the given Java file. If the given file has not been seen before, it will be cached and all future invocations will return the same CompilationUnit.
      Parameters:
      file - a Java file path
      Returns:
      a CompilationUnit for the given file
      Throws:
      IOException - if there is a file I/O error
    • from

      static CachingJavaParser from(com.github.javaparser.JavaParser parser)
      Return a simple implementation of the CachingJavaParser interface.