Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse JDT Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.jdt.core.dom
Interface IMethodBinding

All Superinterfaces:
  IBinding

public interface IMethodBinding
extends IBinding

A method binding represents a method or constructor of a class or interface.

This interface is not intended to be implemented by clients.

Since:
  2.0
See Also:
  `ITypeBinding.getDeclaredMethods()`

Field Summary

Fields inherited from interface org.eclipse.jdt.core.dom.IBinding
`METHOD, PACKAGE, TYPE, VARIABLE`

Method Summary
`ITypeBinding` | `getDeclaringClass()` Returns the type binding representing the class or interface that declares this method or constructor.
`ITypeBinding[]` | `getExceptionTypes()` Returns a list of type bindings representing the types of the exceptions thrown by this method or constructor.
`String` | `getName()` Returns the name of the method declared in this binding.
`ITypeBinding[]` | `getParameterTypes()` Returns a list of type bindings representing the formal parameter types, in declaration order, of this method or constructor.
`ITypeBinding` | `getReturnType()` Returns the binding for the return type of this method.
`ITypeBinding[]` | `getTypeParameters()` Returns the type parameters of this method or constructor binding.
`boolean` | `isConstructor()` Returns whether this binding is for a constructor or a method.
`boolean` | `isDefaultConstructor()` Returns whether this binding is known to be a compiler-generated default constructor.

Methods inherited from interface org.eclipse.jdt.core.dom.IBinding
`equals, getKey, getKind, getModifiers, isDeprecated, isSynthetic, toString`

Method Detail

### isConstructor

    public boolean isConstructor()

  Returns whether this binding is for a constructor or a method.

  Returns:
    `true` if this is the binding for a constructor, and `false` if this is the binding for a method

### isDefaultConstructor

    public boolean isDefaultConstructor()

  Returns whether this binding is known to be a compiler-generated default constructor.

  This method returns `false` for:

  - methods
  - constructors with more than one parameter
  - 0-argument constructors where the binding information was obtained from a Java source file containing an explicit 0-argument constructor declaration
  - 0-argument constructors where the binding information was obtained from a Java class file (it is not possible to determine from a class file whether a 0-argument constructor was present in the source code versus generated automatically by a Java compiler)

  Returns:
    `true` if this is known to be the binding for a compiler-generated default constructor, and `false` otherwise
  Since:
    3.0

### getName

    public String getName()

  Returns the name of the method declared in this binding. The method name is always a simple identifier. The name of a constructor is always the same as the declared name of its declaring class.

  Specified by:
    `getName` in interface `IBinding`
  Returns:
    the name of this method, or the declared name of this constructor's declaring class

### getDeclaringClass

    public ITypeBinding getDeclaringClass()

  Returns the type binding representing the class or interface that declares this method or constructor.

  Returns:
    the binding of the class or interface that declares this method or constructor

### getParameterTypes

    public ITypeBinding[] getParameterTypes()

  Returns a list of type bindings representing the formal parameter types, in declaration order, of this method or constructor. Returns an array of length 0 if this method or constructor does not takes any parameters.

  Note: The result does not include synthetic parameters introduced by inner class emulation.

  Returns:
    a (possibly empty) list of type bindings for the formal parameters of this method or constructor

### getReturnType

    public ITypeBinding getReturnType()

  Returns the binding for the return type of this method. Returns the special primitive `void` return type for constructors.

  Returns:
    the binding for the return type of this method, or the `void` return type for constructors

### getExceptionTypes

    public ITypeBinding[] getExceptionTypes()

  Returns a list of type bindings representing the types of the exceptions thrown by this method or constructor. Returns an array of length 0 if this method throws no exceptions. The resulting types are in no particular order.

  Returns:
    a list of type bindings for exceptions thrown by this method or constructor

### getTypeParameters

    public ITypeBinding[] getTypeParameters()

  Returns the type parameters of this method or constructor binding.

  Note: Support for new language features proposed for the upcoming 1.5 release of J2SE is tentative and subject to change.

  Returns:
    the list of binding for the type variables for the type parameters of this method, or otherwise the empty list
  Since:
    3.0
  See Also:
    `ITypeBinding.isTypeVariable()`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse JDT Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) IBM Corp. and others 2000, 2004. All Rights Reserved.