Package com.github.javaparser.resolution
Interface TypeSolver
-
public interface TypeSolverAn element able to find TypeDeclaration from their name. TypeSolvers are organized in hierarchies.- Author:
- Federico Tomassetti
-
-
Field Summary
Fields Modifier and Type Field Description static StringJAVA_LANG_OBJECTstatic 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(String name)voidsetParent(TypeSolver parent)Set the parent of this TypeSolver.default ResolvedReferenceTypeDeclarationsolveType(String name)Solve the given type.SymbolReference<ResolvedReferenceTypeDeclaration>tryToSolveType(String name)Try to solve the type with the given name.
-
-
-
Field Detail
-
JAVA_LANG_OBJECT
static final String JAVA_LANG_OBJECT
-
JAVA_LANG_RECORD
static final 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(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(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(String name)
-
-