Class MemoryTypeSolver
- java.lang.Object
-
- com.github.javaparser.symbolsolver.resolution.typesolvers.MemoryTypeSolver
-
- All Implemented Interfaces:
TypeSolver
public class MemoryTypeSolver extends java.lang.Object implements TypeSolver
A TypeSolver which only consider the TypeDeclarations provided to it.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,ResolvedReferenceTypeDeclaration>
declarationMap
private TypeSolver
parent
-
Fields inherited from interface com.github.javaparser.resolution.TypeSolver
JAVA_LANG_OBJECT, JAVA_LANG_RECORD
-
-
Constructor Summary
Constructors Constructor Description MemoryTypeSolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDeclaration(java.lang.String name, ResolvedReferenceTypeDeclaration typeDeclaration)
boolean
equals(java.lang.Object o)
TypeSolver
getParent()
Parent of the this TypeSolver.int
hashCode()
void
setParent(TypeSolver parent)
Set the parent of this TypeSolver.java.lang.String
toString()
SymbolReference<ResolvedReferenceTypeDeclaration>
tryToSolveType(java.lang.String name)
Try to solve the type with the given name.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.github.javaparser.resolution.TypeSolver
getRoot, getSolvedJavaLangObject, getSolvedJavaLangRecord, hasType, solveType
-
-
-
-
Field Detail
-
parent
private TypeSolver parent
-
declarationMap
private java.util.Map<java.lang.String,ResolvedReferenceTypeDeclaration> declarationMap
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getParent
public TypeSolver getParent()
Description copied from interface:TypeSolver
Parent of the this TypeSolver. This can return null.- Specified by:
getParent
in interfaceTypeSolver
-
setParent
public void setParent(TypeSolver parent)
Description copied from interface:TypeSolver
Set the parent of this TypeSolver.- Specified by:
setParent
in interfaceTypeSolver
-
addDeclaration
public void addDeclaration(java.lang.String name, ResolvedReferenceTypeDeclaration typeDeclaration)
-
tryToSolveType
public SymbolReference<ResolvedReferenceTypeDeclaration> tryToSolveType(java.lang.String name)
Description copied from interface:TypeSolver
Try to solve the type with the given name. It always return a SymbolReference which can be solved or unsolved.- Specified by:
tryToSolveType
in interfaceTypeSolver
-
-