Class MemberValuePair


  • public class MemberValuePair
    extends ASTNode
    Member value pair node (added in JLS3 API). Member value pairs appear in annotations.

     MemberValuePair:
       SimpleName = Expression
     
    Within annotations, only certain kinds of expressions are meaningful, including other annotations.

    Since:
    3.1
    See Also:
    NormalAnnotation
    Restriction:
    This class is not intended to be instantiated by clients.
    • Method Detail

      • propertyDescriptors

        public static List propertyDescriptors​(int apiLevel)
        Returns a list of structural property descriptors for this node type. Clients must not modify the result.
        Parameters:
        apiLevel - the API level; one of the AST.JLS* constants
        Returns:
        a list of property descriptors (element type: StructuralPropertyDescriptor)
      • getName

        public SimpleName getName()
        Returns the member name.
        Returns:
        the member name node
      • resolveMemberValuePairBinding

        public final IMemberValuePairBinding resolveMemberValuePairBinding()
        Resolves and returns the member value pair binding for this member value pair.

        Note that bindings are generally unavailable unless requested when the AST is being built.

        Returns:
        the binding, or null if the binding cannot be resolved
        Since:
        3.2
      • setName

        public void setName​(SimpleName name)
        Sets the member name.
        Parameters:
        name - the member name node
        Throws:
        IllegalArgumentException - if:
        • the node belongs to a different AST
        • the node already has a parent
      • getValue

        public Expression getValue()
        Returns the value expression.
        Returns:
        the value expression
      • setValue

        public void setValue​(Expression value)
        Sets the value of this pair.
        Parameters:
        value - the new value
        Throws:
        IllegalArgumentException - if:
        • the node belongs to a different AST
        • the node already has a parent
        • a cycle in would be created