Class JavaParserTypeSolver

java.lang.Object
com.github.javaparser.symbolsolver.resolution.typesolvers.JavaParserTypeSolver
All Implemented Interfaces:
TypeSolver

public class JavaParserTypeSolver extends Object implements TypeSolver
Defines a directory containing source code that should be used for solving symbols. The directory must correspond to the root package of the files within.
Author:
Federico Tomassetti
  • Constructor Details

    • JavaParserTypeSolver

      public JavaParserTypeSolver(File srcDir)
    • JavaParserTypeSolver

      public JavaParserTypeSolver(String srcDir)
    • JavaParserTypeSolver

      public JavaParserTypeSolver(Path srcDir)
    • JavaParserTypeSolver

      public JavaParserTypeSolver(File srcDir, ParserConfiguration parserConfiguration)
    • JavaParserTypeSolver

      public JavaParserTypeSolver(String srcDir, ParserConfiguration parserConfiguration)
    • JavaParserTypeSolver

      public JavaParserTypeSolver(Path srcDir, ParserConfiguration parserConfiguration)
    • JavaParserTypeSolver

      public JavaParserTypeSolver(Path srcDir, ParserConfiguration parserConfiguration, long cacheSizeLimit)
      Parameters:
      srcDir - is the source code directory for the type solver.
      parserConfiguration - is the configuration the solver should use when inspecting source code files.
      cacheSizeLimit - is an optional size limit to the internal caches used by this solver. Be advised that setting the size too low might lead to noticeable performance degradation. However, using a size limit is advised when solving symbols in large code sources. In such cases, internal caches might consume large amounts of heap space.
    • JavaParserTypeSolver

      public JavaParserTypeSolver(Path srcDir, JavaParser javaParser, Cache<Path,​Optional<CompilationUnit>> parsedFilesCache, Cache<Path,​List<CompilationUnit>> parsedDirectoriesCache, Cache<String,​SymbolReference<ResolvedReferenceTypeDeclaration>> foundTypesCache)
      Create a JavaParserTypeSolver with a custom cache system.
      Parameters:
      srcDir - The source code directory for the type solver.
      javaParser - The JavaParser to be used when parsing .java files.
      parsedFilesCache - The cache to be used to store CompilationUnit that is associated with a file.
      parsedDirectoriesCache - The cache to store the list of CompilationUnit in a given directory.
      foundTypesCache - The cache that associated a qualified name to its SymbolReference.
  • Method Details