Class MethodReference

Direct Known Subclasses:
CreationReference, ExpressionMethodReference, SuperMethodReference, TypeMethodReference

public abstract class MethodReference extends Expression
Abstract base class of all AST node types that represent a method reference expression (added in JLS8 API).
 MethodReference:
    CreationReference
    ExpressionMethodReference
    SuperMethodReference
    TypeMethodReference
 

A method reference that is represented by a simple or qualified name, followed by ::, followed by a simple name can be represented as ExpressionMethodReference or as TypeMethodReference. The ASTParser currently prefers the first form.

Since:
3.10
See Also:
  • Method Details

    • getTypeArgumentsProperty

      public final ChildListPropertyDescriptor getTypeArgumentsProperty()
      Returns the structural property descriptor for the "typeArguments" property of this node (element type: Type).
      Returns:
      the property descriptor
    • typeArguments

      public List typeArguments()
      Returns the live ordered list of type arguments of this method reference.
      Returns:
      the live list of type arguments (element type: Type)
    • resolveMethodBinding

      public IMethodBinding resolveMethodBinding()
      Resolves and returns the binding for the method referenced by this method reference expression.

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

      Returns:
      the method binding, or null if the binding cannot be resolved