public interface IFunctionBinding extends IBinding
getTypeArguments
returns a non-empty
list, and either isParameterizedMethod
or
isRawMethod
returns true
).
And in certain cases of references to a method declared in a
generic type, the method binding may correspond to a copy of a
method declaration with substitutions for the type's type
parameters (for these, getTypeArguments
returns
an empty list, and both isParameterizedMethod
and
isRawMethod
return false
).
This interface is not intended to be implemented by clients.
Modifier and Type | Method and Description |
---|---|
ITypeBinding |
getDeclaringClass()
Returns the type binding representing the class or interface
that declares this method or constructor.
|
java.lang.Object |
getDefaultValue()
Returns the resolved default value of an annotation type member,
or
null if the member has no default value, or if this
is not the binding for an annotation type member. |
IFunctionBinding |
getMethodDeclaration()
Returns the binding for the method declaration corresponding to this
method binding.
|
java.lang.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.
|
boolean |
isDefaultConstructor()
Returns whether this binding is known to be a compiler-generated
default constructor.
|
boolean |
isSubsignature(IFunctionBinding otherMethod)
Returns whether this method's signature is a subsignature of the given method.
|
boolean |
isVarargs()
Returns whether this is a variable arity method.
|
boolean |
overrides(IFunctionBinding method)
Returns whether this method overrides the given method.
|
equals, getJavaElement, getKey, getKind, getModifiers, isDeprecated, isEqualTo, isRecovered, toString
boolean isConstructor()
true
if this is the binding for a constructor,
and false
if this is the binding for a methodboolean isDefaultConstructor()
This method returns false
for:
true
if this is known to be the binding for a
compiler-generated default constructor, and false
otherwisejava.lang.String getName()
ITypeBinding getDeclaringClass()
java.lang.Object getDefaultValue()
null
if the member has no default value, or if this
is not the binding for an annotation type member.
Resolved values are represented as follows (same as for
IMemberValuePairBinding#getValue()
):
ITypeBinding
for the class objectIVariableBinding
for the enum constantIAnnotationBinding
Object[]
whose elements are as per above
(the language only allows single dimensional arrays in annotations)null
if none or not applicableITypeBinding[] getParameterTypes()
Note that the binding for the last parameter type of a vararg method
declaration like void fun(Foo... args)
is always for
an array type (i.e., Foo[]
) reflecting the the way varargs
get compiled. However, the type binding obtained directly from
the SingleVariableDeclaration
for the vararg parameter
is always for the type as written; i.e., the type binding for
Foo
.
Note: The result does not include synthetic parameters introduced by inner class emulation.
ITypeBinding getReturnType()
void
return type for constructors.void
return type for constructorsIFunctionBinding getMethodDeclaration()
#isParameterizedMethod()
)
and raw methods (#isRawMethod()
), this method returns the binding
for the corresponding generic method. For other method bindings, this
returns the same binding.
Note: The one notable exception is the method Object.getClass()
,
which is declared to return Class<? extends Object>
, but
when invoked its return type becomes Class<? extends
R>
, where R is the compile type of
the receiver of the method invocation.
boolean isSubsignature(IFunctionBinding otherMethod)
true
if this method's signature is a subsignature of the given methodboolean isVarargs()
Note: Variable arity ("varargs") methods were added in JLS3.
true
if this is a variable arity method,
and false
otherwiseboolean overrides(IFunctionBinding method)
method
- the method that is possibly overriddentrue
if this method overrides the given method,
and false
otherwiseCopyright (c) IBM Corp. and others 2000, 2010. All Rights Reserved.