Eclipse JDT
2.0

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.
 boolean isConstructor()
          Returns whether this binding is for a constructor or a method.
 
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

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

Eclipse JDT
2.0

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