public abstract class AbstractJavaParserContext<N extends Node> extends Object implements Context
| Modifier and Type | Field and Description |
|---|---|
protected TypeSolver |
typeSolver |
protected N |
wrappedNode |
| Constructor and Description |
|---|
AbstractJavaParserContext(N wrappedNode,
TypeSolver typeSolver) |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitfieldDeclarationInScope, fieldsExposedToChild, localVariableDeclarationInScope, localVariablesExposedToChild, parameterDeclarationInScope, parametersExposedToChild, solveConstructor, solveGenericType, solveGenericTypeInParentContext, solveMethod, solveMethodInParentContext, solveSymbol, solveSymbolAsValue, solveSymbolAsValueInParentContext, solveType, solveType, solveTypeInParentContext, solveTypeInParentContext, typePatternExprInScope, typePatternExprsExposedToChildprotected TypeSolver typeSolver
public AbstractJavaParserContext(N wrappedNode, TypeSolver typeSolver)
public static SymbolReference<ResolvedValueDeclaration> solveWith(SymbolDeclarator symbolDeclarator, String name)
public SymbolReference<? extends ResolvedValueDeclaration> solveSymbolInParentContext(String name)
solveSymbolInParentContext in interface Contextprotected Optional<Value> solveWithAsValue(SymbolDeclarator symbolDeclarator, String name)
protected Collection<ResolvedReferenceTypeDeclaration> findTypeDeclarations(Optional<Expression> optScope)
public Optional<MethodUsage> solveMethodAsUsage(String name, List<ResolvedType> argumentsTypes)
solveMethodAsUsage in interface Contextpublic N getWrappedNode()
getWrappedNode in interface Contextpublic List<TypePatternExpr> typePatternExprsDiscoveredInPattern(PatternExpr patternExpr)
Foo f), in which case we can just compare
the name of the variable we're trying to resolve with the name declared in the pattern.
2. The pattern expression is a record pattern expression (e.g. Foo (Bar b, Baz (...) )), in which case
we need to traverse the "pattern tree" to find all type pattern expressions, so that we can compare names
for all of these.
In both cases, we only really care about the type pattern expressions, so this method simply does a traversal
of the pattern tree to find all type pattern expressions contained in it.patternExpr - the root of the pattern tree to traversepublic SymbolReference<? extends ResolvedValueDeclaration> findExposedPatternInParentContext(Node parent, String name)
public List<TypePatternExpr> typePatternExprsExposedFromChildren()
typePatternExprsExposedFromChildren in interface Contextpublic List<TypePatternExpr> negatedTypePatternExprsExposedFromChildren()
negatedTypePatternExprsExposedFromChildren in interface ContextCopyright © 2007–2024. All rights reserved.