Package com.github.javaparser.resolution
Interface TypeSolver
-
- All Known Implementing Classes:
AarTypeSolver,ClassLoaderTypeSolver,CombinedTypeSolver,JarTypeSolver,JavaParserTypeSolver,MemoryTypeSolver,ReflectionTypeSolver
public interface TypeSolverAn element able to find TypeDeclaration from their name. TypeSolvers are organized in hierarchies.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringJAVA_LANG_OBJECTstatic java.lang.StringJAVA_LANG_RECORD
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description TypeSolvergetParent()Parent of the this TypeSolver.default TypeSolvergetRoot()Get the root of the hierarchy of type solver.default ResolvedReferenceTypeDeclarationgetSolvedJavaLangObject()default ResolvedReferenceTypeDeclarationgetSolvedJavaLangRecord()default booleanhasType(java.lang.String name)voidsetParent(TypeSolver parent)Set the parent of this TypeSolver.default ResolvedReferenceTypeDeclarationsolveType(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)
-
-