Package com.github.javaparser.resolution
Interface TypeSolver
-
- All Known Implementing Classes:
AarTypeSolver
,ClassLoaderTypeSolver
,CombinedTypeSolver
,JarTypeSolver
,JavaParserTypeSolver
,MemoryTypeSolver
,ReflectionTypeSolver
public interface TypeSolver
An element able to find TypeDeclaration from their name. TypeSolvers are organized in hierarchies.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
JAVA_LANG_OBJECT
static java.lang.String
JAVA_LANG_RECORD
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description TypeSolver
getParent()
Parent of the this TypeSolver.default TypeSolver
getRoot()
Get the root of the hierarchy of type solver.default ResolvedReferenceTypeDeclaration
getSolvedJavaLangObject()
default ResolvedReferenceTypeDeclaration
getSolvedJavaLangRecord()
default boolean
hasType(java.lang.String name)
void
setParent(TypeSolver parent)
Set the parent of this TypeSolver.default ResolvedReferenceTypeDeclaration
solveType(java.lang.String name)
Solve the given type.SymbolReference<ResolvedReferenceTypeDeclaration>
tryToSolveType(java.lang.String name)
Try to solve the type with the given name.
-
-
-
Field Detail
-
JAVA_LANG_OBJECT
static final java.lang.String JAVA_LANG_OBJECT
-
JAVA_LANG_RECORD
static final java.lang.String JAVA_LANG_RECORD
- See Also:
- Constant Field Values
-
-
Method Detail
-
getRoot
default TypeSolver getRoot()
Get the root of the hierarchy of type solver.
-
getParent
TypeSolver getParent()
Parent of the this TypeSolver. This can return null.
-
setParent
void setParent(TypeSolver parent)
Set the parent of this TypeSolver.
-
tryToSolveType
SymbolReference<ResolvedReferenceTypeDeclaration> tryToSolveType(java.lang.String name)
Try to solve the type with the given name. It always return a SymbolReference which can be solved or unsolved.
-
solveType
default ResolvedReferenceTypeDeclaration solveType(java.lang.String name) throws UnsolvedSymbolException
Solve the given type. Either the type is found and returned or an UnsolvedSymbolException is thrown.- Throws:
UnsolvedSymbolException
-
getSolvedJavaLangObject
default ResolvedReferenceTypeDeclaration getSolvedJavaLangObject() throws UnsolvedSymbolException
- Returns:
- A resolved reference to
java.lang.Object
- Throws:
UnsolvedSymbolException
-
getSolvedJavaLangRecord
default ResolvedReferenceTypeDeclaration getSolvedJavaLangRecord() throws UnsolvedSymbolException
- Returns:
- A resolved reference to
java.lang.Record
- Throws:
UnsolvedSymbolException
-
hasType
default boolean hasType(java.lang.String name)
-
-