Interface ASTMemberValue
- All Superinterfaces:
GenericNode<JavaNode>,JavaNode,JjtreeNode<JavaNode>,Node,Reportable,TextAvailableNode
- All Known Subinterfaces:
ASTAssignableExpr,ASTAssignableExpr.ASTNamedReferenceExpr,ASTExpression,ASTLiteral,ASTPrimaryExpression,FunctionalExpression,QualifiableExpression
- All Known Implementing Classes:
ASTAmbiguousName,ASTAnnotation,ASTArrayAccess,ASTArrayAllocation,ASTArrayInitializer,ASTAssignmentExpression,ASTBooleanLiteral,ASTCastExpression,ASTCharLiteral,ASTClassLiteral,ASTConditionalExpression,ASTConstructorCall,ASTFieldAccess,ASTInfixExpression,ASTLambdaExpression,ASTMemberValueArrayInitializer,ASTMethodCall,ASTMethodReference,ASTNullLiteral,ASTNumericLiteral,ASTPatternExpression,ASTStringLiteral,ASTSuperExpression,ASTSwitchExpression,ASTThisExpression,ASTTypeExpression,ASTUnaryExpression,ASTVariableAccess
Represents the value of a member of an annotation.
This can appear in a member-value pair,
or in the default clause of an annotation
method.
MemberValue ::=Annotation|MemberValueArrayInitializer|< any constant expression >
-
Field Summary
Fields inherited from interface net.sourceforge.pmd.lang.ast.Node
COORDS_COMPARATOR -
Method Summary
Modifier and TypeMethodDescriptiondefault @Nullable ObjectReturns the constant value of this node, if this is a constant expression.Methods inherited from interface net.sourceforge.pmd.lang.ast.impl.GenericNode
ancestors, ancestorsOrSelf, asStream, children, descendants, descendantsOrSelf, getChild, getFirstChild, getLastChild, getNextSibling, getParent, getPreviousSiblingMethods inherited from interface net.sourceforge.pmd.lang.java.ast.JavaNode
getEnclosingType, getRoot, getSymbolTable, getTypeSystemMethods inherited from interface net.sourceforge.pmd.lang.ast.impl.javacc.JjtreeNode
getFirstToken, getLastToken, tokensMethods 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, isFindBoundaryMethods inherited from interface net.sourceforge.pmd.lang.ast.TextAvailableNode
getOriginalText, getText, getTextRegion
-
Method Details
-
getConstValue
Returns the constant value of this node, if this is a constant expression. Otherwise, or if some references couldn't be resolved, returns null. Note thatnullis not a constant value, so this method's returning null is not a problem. Note that annotations are not given a constant value by this implementation.
-