Class ClassLoaderTypeSolver
- java.lang.Object
-
- com.github.javaparser.symbolsolver.resolution.typesolvers.ClassLoaderTypeSolver
-
- All Implemented Interfaces:
TypeSolver
- Direct Known Subclasses:
ReflectionTypeSolver
public class ClassLoaderTypeSolver extends java.lang.Object implements TypeSolver
This TypeSolver wraps a ClassLoader. It can solve all types that the given ClassLoader can load. This is intended to be used with custom classloaders. To support typical cases based on reflection just use the ReflectionTypeSolver
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.ClassLoaderclassLoaderprivate TypeSolverparent-
Fields inherited from interface com.github.javaparser.resolution.TypeSolver
JAVA_LANG_OBJECT, JAVA_LANG_RECORD
-
-
Constructor Summary
Constructors Constructor Description ClassLoaderTypeSolver(java.lang.ClassLoader classLoader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanfilterName(java.lang.String name)TypeSolvergetParent()Parent of the this TypeSolver.voidsetParent(TypeSolver parent)Set the parent of this TypeSolver.SymbolReference<ResolvedReferenceTypeDeclaration>tryToSolveType(java.lang.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, toString, wait, wait, wait
-
Methods inherited from interface com.github.javaparser.resolution.TypeSolver
getRoot, getSolvedJavaLangObject, getSolvedJavaLangRecord, hasType, solveType
-
-
-
-
Field Detail
-
parent
private TypeSolver parent
-
classLoader
private java.lang.ClassLoader classLoader
-
-
Method Detail
-
getParent
public TypeSolver getParent()
Description copied from interface:TypeSolverParent of the this TypeSolver. This can return null.- Specified by:
getParentin interfaceTypeSolver
-
setParent
public void setParent(TypeSolver parent)
Description copied from interface:TypeSolverSet the parent of this TypeSolver.- Specified by:
setParentin interfaceTypeSolver
-
filterName
protected boolean filterName(java.lang.String name)
-
tryToSolveType
public SymbolReference<ResolvedReferenceTypeDeclaration> tryToSolveType(java.lang.String name)
Description copied from interface:TypeSolverTry to solve the type with the given name. It always return a SymbolReference which can be solved or unsolved.- Specified by:
tryToSolveTypein interfaceTypeSolver
-
-