Interface ASTMemberValue

All Superinterfaces:
net.sourceforge.pmd.lang.ast.impl.GenericNode<JavaNode>, JavaNode, net.sourceforge.pmd.lang.ast.impl.javacc.JjtreeNode<JavaNode>, net.sourceforge.pmd.lang.ast.Node, net.sourceforge.pmd.reporting.Reportable, net.sourceforge.pmd.lang.ast.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

public interface ASTMemberValue extends JavaNode
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 Type
    Method
    Description
    default @Nullable Object
    Returns 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, 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
  • Method Details

    • getConstValue

      default @Nullable Object 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 that null is 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.