Class ExpressionMethodReference


  • public class ExpressionMethodReference
    extends MethodReference
    Expression method reference AST node type (added in JLS8 API).
     ExpressionMethodReference:
         Expression :: 
             [ < Type { , Type } > ]
             Identifier
     
    Since:
    3.10
    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)
      • getExpression

        public Expression getExpression()
        Returns the expression of this expression method reference expression
        Returns:
        the expression node
      • setExpression

        public void setExpression​(Expression expression)
        Sets the expression of this expression method reference.
        Parameters:
        expression - the expression node
        Throws:
        IllegalArgumentException - if:
        • the node belongs to a different AST
        • the node already has a parent
        • a cycle in would be created
      • typeArguments

        public List typeArguments()
        Returns the live ordered list of type arguments of this expression method reference
        Overrides:
        typeArguments in class MethodReference
        Returns:
        the live list of type arguments (element type: Type)
      • getName

        public SimpleName getName()
        Returns the name of the method referenced in this expression.
        Returns:
        the method name node
      • setName

        public void setName​(SimpleName name)
        Sets the name of the method referenced in this expression to the given name.
        Parameters:
        name - the new method name
        Throws:
        IllegalArgumentException - if:
        • the node belongs to a different AST
        • the node already has a parent