Class ArrayAccessExprContext
- java.lang.Object
-
- com.github.javaparser.symbolsolver.javaparsermodel.contexts.AbstractJavaParserContext<N>
-
- com.github.javaparser.symbolsolver.javaparsermodel.contexts.ExpressionContext<com.github.javaparser.ast.expr.ArrayAccessExpr>
-
- com.github.javaparser.symbolsolver.javaparsermodel.contexts.ArrayAccessExprContext
-
- All Implemented Interfaces:
com.github.javaparser.resolution.Context
public class ArrayAccessExprContext extends ExpressionContext<com.github.javaparser.ast.expr.ArrayAccessExpr>
Required to prevent recursive access to the "parent node" (not necessarily the same as the "parent context").
Consider, for example, this code where the cursor is currently at the node of type
ArrayAccessExpr:var1.perPriority[index].recovered ^^^^^^^^^^^^^^^^^^^^^^^ - ArrayAccessExprThe AST for this snippet:
FieldAccessExpr // This FieldAccessExpr is accessing the field `recovered` / \ **ArrayAccessExpr** SimpleName(recovered) / \ FieldAccessExpr NameExpr(index) // This FieldAccessExpr is accessing the field `perPriority` / \ NameExpr(var1) SimpleName (perPriority)In this example:
-
The parent node for
ArrayAccessExprisFieldAccessExpr(variable1.perPriority[index].recovered).// "Parent Node" of the ArrayAccessExpr var.perPriority[index].recovered ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - FieldAccessExpr ^^^^^^^^^^^^^^^^^^^^^^ - ArrayAccessExpr ^^^^^^^^^ - SimpleName -
The parent context is the
FieldAccessExprto the left of the outer array-access, which is actually a child node.// "Parent Context" of the ArrayAccessExpr var1.perPriority[index].recovered ^^^^^^^^^^^^^^^^^^^^^^^ - ArrayAccessExpr ^^^^^^^^^^^^^^^^ - FieldAccessExpr ^^^^^ - NameExpr
- Author:
- Roger Howell
-
-
Field Summary
-
Fields inherited from class com.github.javaparser.symbolsolver.javaparsermodel.contexts.AbstractJavaParserContext
typeSolver, wrappedNode
-
-
Constructor Summary
Constructors Constructor Description ArrayAccessExprContext(com.github.javaparser.ast.expr.ArrayAccessExpr wrappedNode, com.github.javaparser.resolution.TypeSolver typeSolver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.github.javaparser.resolution.model.SymbolReference<? extends com.github.javaparser.resolution.declarations.ResolvedValueDeclaration>solveSymbolInParentContext(String name)-
Methods inherited from class com.github.javaparser.symbolsolver.javaparsermodel.contexts.ExpressionContext
solveSymbol, solveSymbolAsValue
-
Methods inherited from class com.github.javaparser.symbolsolver.javaparsermodel.contexts.AbstractJavaParserContext
equals, findExposedPatternInParentContext, findTypeDeclarations, getParent, getScope, getWrappedNode, hashCode, negatedTypePatternExprsExposedFromChildren, solveMethodAsUsage, solveWith, solveWithAsValue, typePatternExprsDiscoveredInPattern, typePatternExprsExposedFromChildren
-
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, parameterDeclarationInScope, parametersExposedToChild, solveConstructor, solveGenericType, solveGenericTypeInParentContext, solveMethod, solveMethodInParentContext, solveSymbolAsValueInParentContext, solveType, solveType, solveTypeInParentContext, solveTypeInParentContext, typePatternExprInScope, typePatternExprsExposedToChild
-
-
-
-
Method Detail
-
solveSymbolInParentContext
public com.github.javaparser.resolution.model.SymbolReference<? extends com.github.javaparser.resolution.declarations.ResolvedValueDeclaration> solveSymbolInParentContext(String name)
- Specified by:
solveSymbolInParentContextin interfacecom.github.javaparser.resolution.Context- Overrides:
solveSymbolInParentContextin classAbstractJavaParserContext<com.github.javaparser.ast.expr.ArrayAccessExpr>
-
-