Class AbstractJavaParserContext<N extends Node>
- java.lang.Object
-
- com.github.javaparser.symbolsolver.javaparsermodel.contexts.AbstractJavaParserContext<N>
-
- All Implemented Interfaces:
Context
- Direct Known Subclasses:
AbstractMethodLikeDeclarationContext,AnnotationDeclarationContext,AnonymousClassDeclarationContext,ArrayAccessExprContext,BinaryExprContext,BlockStmtContext,CatchClauseContext,ClassOrInterfaceDeclarationContext,ClassOrInterfaceDeclarationExtendsContext,CompilationUnitContext,EnclosedExprContext,EnumDeclarationContext,FieldAccessContext,ForEachStatementContext,ForStatementContext,InstanceOfExprContext,LambdaExprContext,MethodCallExprContext,MethodReferenceExprContext,ObjectCreationContext,StatementContext,SwitchEntryContext,TryWithResourceContext,UnaryExprContext,VariableDeclarationExprContext,VariableDeclaratorContext
public abstract class AbstractJavaParserContext<N extends Node> extends Object implements Context
- Author:
- Federico Tomassetti
-
-
Field Summary
Fields Modifier and Type Field Description protected TypeSolvertypeSolverprotected NwrappedNode
-
Constructor Summary
Constructors Constructor Description AbstractJavaParserContext(N wrappedNode, TypeSolver typeSolver)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)protected Collection<ResolvedReferenceTypeDeclaration>findTypeDeclarations(Optional<Expression> optScope)Optional<Context>getParent()protected NodegetScope(Node node)NgetWrappedNode()Returns the node wrapped in the contextinthashCode()protected static booleanisQualifiedName(String name)Optional<MethodUsage>solveMethodAsUsage(String name, List<ResolvedType> argumentsTypes)Similar to solveMethod but we return a MethodUsage.SymbolReference<? extends ResolvedValueDeclaration>solveSymbolInParentContext(String name)static SymbolReference<ResolvedValueDeclaration>solveWith(SymbolDeclarator symbolDeclarator, String name)protected Optional<Value>solveWithAsValue(SymbolDeclarator symbolDeclarator, String name)-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.github.javaparser.resolution.Context
fieldDeclarationInScope, fieldsExposedToChild, localVariableDeclarationInScope, localVariablesExposedToChild, negatedPatternExprsExposedFromChildren, parameterDeclarationInScope, parametersExposedToChild, patternExprInScope, patternExprsExposedFromChildren, patternExprsExposedToChild, solveConstructor, solveGenericType, solveGenericTypeInParentContext, solveMethod, solveMethodInParentContext, solveSymbol, solveSymbolAsValue, solveSymbolAsValueInParentContext, solveType, solveType, solveTypeInParentContext, solveTypeInParentContext
-
-
-
-
Field Detail
-
typeSolver
protected TypeSolver typeSolver
-
-
Constructor Detail
-
AbstractJavaParserContext
public AbstractJavaParserContext(N wrappedNode, TypeSolver typeSolver)
-
-
Method Detail
-
isQualifiedName
protected static boolean isQualifiedName(String name)
-
solveWith
public static SymbolReference<ResolvedValueDeclaration> solveWith(SymbolDeclarator symbolDeclarator, String name)
-
solveSymbolInParentContext
public SymbolReference<? extends ResolvedValueDeclaration> solveSymbolInParentContext(String name)
- Specified by:
solveSymbolInParentContextin interfaceContext
-
solveWithAsValue
protected Optional<Value> solveWithAsValue(SymbolDeclarator symbolDeclarator, String name)
-
findTypeDeclarations
protected Collection<ResolvedReferenceTypeDeclaration> findTypeDeclarations(Optional<Expression> optScope)
-
solveMethodAsUsage
public Optional<MethodUsage> solveMethodAsUsage(String name, List<ResolvedType> argumentsTypes)
Similar to solveMethod but we return a MethodUsage. A MethodUsage corresponds to a MethodDeclaration plus the resolved type variables.- Specified by:
solveMethodAsUsagein interfaceContext
-
getWrappedNode
public N getWrappedNode()
Description copied from interface:ContextReturns the node wrapped in the context- Specified by:
getWrappedNodein interfaceContext
-
-