Class JavaParserTypeSolver
java.lang.Object
com.github.javaparser.symbolsolver.resolution.typesolvers.JavaParserTypeSolver
- All Implemented Interfaces:
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
-
Field Summary
Fields inherited from interface com.github.javaparser.symbolsolver.model.resolution.TypeSolver
JAVA_LANG_OBJECT
-
Constructor Summary
ConstructorDescriptionJavaParserTypeSolver(File srcDir)
JavaParserTypeSolver(File srcDir, ParserConfiguration parserConfiguration)
JavaParserTypeSolver(String srcDir)
JavaParserTypeSolver(String srcDir, ParserConfiguration parserConfiguration)
JavaParserTypeSolver(Path srcDir)
JavaParserTypeSolver(Path srcDir, ParserConfiguration parserConfiguration)
JavaParserTypeSolver(Path srcDir, ParserConfiguration parserConfiguration, long cacheSizeLimit)
-
Method Summary
Modifier and TypeMethodDescriptionParent of the this TypeSolver.void
setParent(TypeSolver parent)
Set the parent of this TypeSolver.toString()
tryToSolveType(String name)
Try to solve the type with the given name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.github.javaparser.symbolsolver.model.resolution.TypeSolver
getRoot, getSolvedJavaLangObject, hasType, solveType
-
Constructor Details
-
JavaParserTypeSolver
-
JavaParserTypeSolver
-
JavaParserTypeSolver
-
JavaParserTypeSolver
-
JavaParserTypeSolver
-
JavaParserTypeSolver
-
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.
-
-
Method Details
-
toString
-
getParent
Description copied from interface:TypeSolver
Parent of the this TypeSolver. This can return null.- Specified by:
getParent
in interfaceTypeSolver
-
setParent
Description copied from interface:TypeSolver
Set the parent of this TypeSolver.- Specified by:
setParent
in interfaceTypeSolver
-
tryToSolveType
Description copied from interface:TypeSolver
Try to solve the type with the given name. It always return a SymbolReference which can be solved or unsolved.- Specified by:
tryToSolveType
in interfaceTypeSolver
-