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.- Author:
- Federico Tomassetti
-
-
Field Summary
Fields Modifier and Type Field Description static String
JAVA_LANG_OBJECT
-
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 boolean
hasType(String name)
void
setParent(TypeSolver parent)
Set the parent of this TypeSolver.default ResolvedReferenceTypeDeclaration
solveType(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
-
-
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
-
hasType
default boolean hasType(String name)
-
-