Interface ASTAssignableExpr
-
- All Superinterfaces:
ASTExpression
,ASTMemberValue
,ASTPrimaryExpression
,ASTSwitchArrowRHS
,GenericNode<JavaNode>
,JavaNode
,JjtreeNode<JavaNode>
,Node
,Reportable
,TextAvailableNode
,TypeNode
- All Known Subinterfaces:
ASTAssignableExpr.ASTNamedReferenceExpr
- All Known Implementing Classes:
ASTArrayAccess
,ASTFieldAccess
,ASTVariableAccess
public interface ASTAssignableExpr extends ASTPrimaryExpression
An expression that may be assigned by an assignment expression, or incremented or decremented. In the JLS, the result of such expressions is a variable, while other expressions evaluate to a value. The distinction is equivalent to C-world lvalue, rvalue.AssignableExpr ::=
VariableAccess
|FieldAccess
|ArrayAccess
- Author:
- Clément Fournier
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ASTAssignableExpr.AccessType
Represents the type of access of an assignable expression.static interface
ASTAssignableExpr.ASTNamedReferenceExpr
An assignable expression that has a name, and refers to a symbol.
-
Field Summary
-
Fields inherited from interface net.sourceforge.pmd.lang.ast.Node
COORDS_COMPARATOR
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default @NonNull ASTAssignableExpr.AccessType
getAccessType()
Returns how this expression is accessed in the enclosing expression.-
Methods inherited from interface net.sourceforge.pmd.lang.java.ast.ASTExpression
getConstValue, getConversionContext, getParenthesisDepth, isCompileTimeConstant, isExpression, isParenthesized
-
Methods inherited from interface net.sourceforge.pmd.lang.ast.impl.GenericNode
ancestors, ancestorsOrSelf, asStream, children, descendants, descendantsOrSelf, getChild, getFirstChild, getLastChild, getNextSibling, getParent, getPreviousSibling
-
Methods inherited from interface net.sourceforge.pmd.lang.java.ast.JavaNode
getEnclosingType, getRoot, getSymbolTable, getTypeSystem
-
Methods inherited from interface net.sourceforge.pmd.lang.ast.impl.javacc.JjtreeNode
getFirstToken, getLastToken, tokens
-
Methods inherited from interface net.sourceforge.pmd.lang.ast.Node
acceptVisitor, ancestors, children, compareLocation, descendants, firstChild, getAstInfo, getBeginColumn, getBeginLine, getEndColumn, getEndLine, getImage, getIndexInParent, getLanguageVersion, getNumChildren, getReportLocation, getTextDocument, getUserMap, getXPathAttributesIterator, getXPathNodeName, hasImageEqualTo, isFindBoundary
-
Methods inherited from interface net.sourceforge.pmd.lang.ast.TextAvailableNode
getOriginalText, getText, getTextRegion
-
Methods inherited from interface net.sourceforge.pmd.lang.java.ast.TypeNode
getTypeMirror, getTypeMirror
-
-
-
-
Method Detail
-
getAccessType
default @NonNull ASTAssignableExpr.AccessType getAccessType()
Returns how this expression is accessed in the enclosing expression. If this expression occurs as the left-hand-side of an assignment, or as the target of an increment or decrement expression, this method returnsASTAssignableExpr.AccessType.WRITE
. Otherwise the value is just read.- See Also:
JavaAstUtils.isVarAccessReadAndWrite(ASTNamedReferenceExpr)
,JavaAstUtils.isVarAccessStrictlyWrite(ASTNamedReferenceExpr)
-
-