org.eclipse.jdt.internal.compiler.lookup
Class MethodBinding

java.lang.Object
  extended by org.eclipse.jdt.internal.compiler.lookup.Binding
      extended by org.eclipse.jdt.internal.compiler.lookup.MethodBinding
All Implemented Interfaces:
TypeConstants
Direct Known Subclasses:
ParameterizedMethodBinding, ProblemMethodBinding, SyntheticMethodBinding, UpdatedMethodBinding

public class MethodBinding
extends Binding
implements TypeConstants


Field Summary
 ReferenceBinding declaringClass
           
 int modifiers
           
 TypeBinding[] parameters
           
 TypeBinding returnType
           
 char[] selector
           
 long tagBits
           
 ReferenceBinding[] thrownExceptions
           
 TypeVariableBinding[] typeVariables
           
 
Fields inherited from class org.eclipse.jdt.internal.compiler.lookup.Binding
ANY_EXCEPTION, ARRAY_TYPE, BASE_TYPE, FIELD, GENERIC_TYPE, IMPORT, LOCAL, METHOD, NO_ANNOTATIONS, NO_ELEMENT_VALUE_PAIRS, NO_EXCEPTIONS, NO_FIELDS, NO_MEMBER_TYPES, NO_METHODS, NO_PARAMETERS, NO_SUPERINTERFACES, NO_TYPE_VARIABLES, NO_TYPES, PACKAGE, PARAMETERIZED_TYPE, RAW_TYPE, TYPE, TYPE_PARAMETER, VARIABLE, WILDCARD_TYPE
 
Fields inherited from interface org.eclipse.jdt.internal.compiler.lookup.TypeConstants
ANNOTATION, ANNOTATION_PREFIX, ANNOTATION_SUFFIX, ANONYM_PREFIX, ANONYM_SUFFIX, BOOLEAN, BYTE, CHAR, CharArray_JAVA_IO_OBJECTINPUTSTREAM, CharArray_JAVA_IO_OBJECTOUTPUTSTREAM, CharArray_JAVA_IO_OBJECTSTREAMFIELD, CharArray_JAVA_LANG_ANNOTATION_ANNOTATION, CharArray_JAVA_LANG_ENUM, CharArray_JAVA_LANG_OBJECT, CLINIT, CLONE, CONSTRAINT_EQUAL, CONSTRAINT_EXTENDS, CONSTRAINT_SUPER, DOUBLE, FLOAT, GETCLASS, INIT, INT, IO, JAVA, JAVA_IO, JAVA_IO_PRINTSTREAM, JAVA_IO_SERIALIZABLE, JAVA_LANG, JAVA_LANG_ANNOTATION_ANNOTATION, JAVA_LANG_ANNOTATION_DOCUMENTED, JAVA_LANG_ANNOTATION_ELEMENTTYPE, JAVA_LANG_ANNOTATION_INHERITED, JAVA_LANG_ANNOTATION_RETENTION, JAVA_LANG_ANNOTATION_RETENTIONPOLICY, JAVA_LANG_ANNOTATION_TARGET, JAVA_LANG_ASSERTIONERROR, JAVA_LANG_BOOLEAN, JAVA_LANG_BYTE, JAVA_LANG_CHARACTER, JAVA_LANG_CLASS, JAVA_LANG_CLASSNOTFOUNDEXCEPTION, JAVA_LANG_CLONEABLE, JAVA_LANG_DEPRECATED, JAVA_LANG_DOUBLE, JAVA_LANG_ENUM, JAVA_LANG_ERROR, JAVA_LANG_EXCEPTION, JAVA_LANG_FLOAT, JAVA_LANG_ILLEGALARGUMENTEXCEPTION, JAVA_LANG_INTEGER, JAVA_LANG_ITERABLE, JAVA_LANG_LONG, JAVA_LANG_NOCLASSDEFERROR, JAVA_LANG_OBJECT, JAVA_LANG_OVERRIDE, JAVA_LANG_REFLECT_CONSTRUCTOR, JAVA_LANG_REFLECT_FIELD, JAVA_LANG_REFLECT_METHOD, JAVA_LANG_RUNTIMEEXCEPTION, JAVA_LANG_SHORT, JAVA_LANG_STRING, JAVA_LANG_STRINGBUFFER, JAVA_LANG_STRINGBUILDER, JAVA_LANG_SUPPRESSWARNINGS, JAVA_LANG_SYSTEM, JAVA_LANG_THROWABLE, JAVA_LANG_VOID, JAVA_UTIL_ITERATOR, LANG, LENGTH, LONG, MAIN, MISMATCH, NULL, OBJECT, OK, PACKAGE_INFO_NAME, READOBJECT, READRESOLVE, REFLECT, SERIALPERSISTENTFIELDS, SERIALVERSIONUID, SHORT, SYNTHETIC_ACCESS_METHOD_PREFIX, SYNTHETIC_ASSERT_DISABLED, SYNTHETIC_CLASS, SYNTHETIC_ENCLOSING_INSTANCE_PREFIX, SYNTHETIC_ENUM_VALUES, SYNTHETIC_OUTER_LOCAL_PREFIX, SYNTHETIC_SWITCH_ENUM_TABLE, TYPE, UNCHECKED, UPPER_ANNOTATION_TYPE, UPPER_CLASS, UPPER_CONSTRUCTOR, UPPER_FIELD, UPPER_LOCAL_VARIABLE, UPPER_METHOD, UPPER_PACKAGE, UPPER_PARAMETER, UPPER_RUNTIME, UPPER_SOURCE, VALUE, VALUEOF, VALUES, VOID, WILDCARD_CAPTURE, WILDCARD_CAPTURE_NAME, WILDCARD_EXTENDS, WILDCARD_MINUS, WILDCARD_NAME, WILDCARD_PLUS, WILDCARD_STAR, WILDCARD_SUPER, WRITEOBJECT, WRITEREPLACE
 
Constructor Summary
protected MethodBinding()
           
  MethodBinding(int modifiers, char[] selector, TypeBinding returnType, TypeBinding[] parameters, ReferenceBinding[] thrownExceptions, ReferenceBinding declaringClass)
           
  MethodBinding(int modifiers, TypeBinding[] parameters, ReferenceBinding[] thrownExceptions, ReferenceBinding declaringClass)
           
  MethodBinding(MethodBinding initialMethodBinding, ReferenceBinding declaringClass)
           
 
Method Summary
 boolean areParameterErasuresEqual(MethodBinding method)
           
 boolean areParametersCompatibleWith(TypeBinding[] arguments)
           
 boolean areParametersEqual(MethodBinding method)
           
 boolean areTypeVariableErasuresEqual(MethodBinding method)
           
 boolean canBeSeenBy(InvocationSite invocationSite, Scope scope)
           
 boolean canBeSeenBy(PackageBinding invocationPackage)
           
 boolean canBeSeenBy(TypeBinding receiverType, InvocationSite invocationSite, Scope scope)
           
 char[] computeUniqueKey(boolean isLeaf)
           
 TypeBinding constantPoolDeclaringClass()
           
 char[] constantPoolName()
           
 char[] genericSignature()
          
 int getAccessFlags()
           
 AnnotationBinding[] getAnnotations()
           
 long getAnnotationTagBits()
          Compute the tagbits for standard annotations.
 java.lang.Object getDefaultValue()
           
 AnnotationBinding[] getParameterAnnotations(int index)
           
 TypeVariableBinding getTypeVariable(char[] variableName)
           
 boolean hasSubstitutedParameters()
          Returns true if method got substituted parameter types (see ParameterizedMethodBinding)
 boolean hasSubstitutedReturnType()
           
 boolean isAbstract()
           
 boolean isBridge()
           
 boolean isConstructor()
           
 boolean isDefault()
           
 boolean isDefaultAbstract()
           
 boolean isDeprecated()
           
 boolean isFinal()
           
 boolean isImplementing()
           
 boolean isMain()
           
 boolean isNative()
           
 boolean isOverriding()
           
 boolean isPrivate()
           
 boolean isProtected()
           
 boolean isPublic()
           
 boolean isStatic()
           
 boolean isStrictfp()
           
 boolean isSynchronized()
           
 boolean isSynthetic()
           
 boolean isUsed()
           
 boolean isVarargs()
           
 boolean isViewedAsDeprecated()
           
 int kind()
           
 MethodBinding original()
          Returns the original method (as opposed to parameterized instances)
 char[] readableName()
           
 void setAnnotations(AnnotationBinding[] annotations)
           
 void setAnnotations(AnnotationBinding[] annotations, AnnotationBinding[][] parameterAnnotations, java.lang.Object defaultValue)
           
 void setDefaultValue(java.lang.Object defaultValue)
           
 void setParameterAnnotations(AnnotationBinding[][] parameterAnnotations)
           
protected  void setSelector(char[] selector)
           
 char[] shortReadableName()
           
 char[] signature()
           
 int sourceEnd()
           
 AbstractMethodDeclaration sourceMethod()
           
 int sourceStart()
           
 MethodBinding tiebreakMethod()
          Returns the method to use during tiebreak (usually the method itself).
 java.lang.String toString()
           
 TypeVariableBinding[] typeVariables()
           
 
Methods inherited from class org.eclipse.jdt.internal.compiler.lookup.Binding
computeUniqueKey, initializeDeprecatedAnnotationTagBits, isValidBinding, problemId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

modifiers

public int modifiers

selector

public char[] selector

returnType

public TypeBinding returnType

parameters

public TypeBinding[] parameters

thrownExceptions

public ReferenceBinding[] thrownExceptions

declaringClass

public ReferenceBinding declaringClass

typeVariables

public TypeVariableBinding[] typeVariables

tagBits

public long tagBits
Constructor Detail

MethodBinding

protected MethodBinding()

MethodBinding

public MethodBinding(int modifiers,
                     char[] selector,
                     TypeBinding returnType,
                     TypeBinding[] parameters,
                     ReferenceBinding[] thrownExceptions,
                     ReferenceBinding declaringClass)

MethodBinding

public MethodBinding(int modifiers,
                     TypeBinding[] parameters,
                     ReferenceBinding[] thrownExceptions,
                     ReferenceBinding declaringClass)

MethodBinding

public MethodBinding(MethodBinding initialMethodBinding,
                     ReferenceBinding declaringClass)
Method Detail

areParameterErasuresEqual

public final boolean areParameterErasuresEqual(MethodBinding method)

areParametersEqual

public final boolean areParametersEqual(MethodBinding method)

areParametersCompatibleWith

public final boolean areParametersCompatibleWith(TypeBinding[] arguments)

kind

public final int kind()
Specified by:
kind in class Binding

canBeSeenBy

public final boolean canBeSeenBy(PackageBinding invocationPackage)

areTypeVariableErasuresEqual

public final boolean areTypeVariableErasuresEqual(MethodBinding method)

canBeSeenBy

public final boolean canBeSeenBy(InvocationSite invocationSite,
                                 Scope scope)

canBeSeenBy

public final boolean canBeSeenBy(TypeBinding receiverType,
                                 InvocationSite invocationSite,
                                 Scope scope)

computeUniqueKey

public char[] computeUniqueKey(boolean isLeaf)
Overrides:
computeUniqueKey in class Binding

constantPoolDeclaringClass

public TypeBinding constantPoolDeclaringClass()

constantPoolName

public final char[] constantPoolName()

genericSignature

public char[] genericSignature()
(param1 ... paramN)returnType thrownException1 ... thrownExceptionP T foo(T t) throws X ---> (TT;)TT;LX; void bar(X t) --> (LX;)V void bar(X t) --> (LX;)V


getAnnotations

public AnnotationBinding[] getAnnotations()

getParameterAnnotations

public AnnotationBinding[] getParameterAnnotations(int index)
Parameters:
index - the index of the parameter of interest
Returns:
the annotations on the indexth parameter
Throws:
java.lang.ArrayIndexOutOfBoundsException - when index is not valid

getAccessFlags

public final int getAccessFlags()

getAnnotationTagBits

public long getAnnotationTagBits()
Compute the tagbits for standard annotations. For source types, these could require lazily resolving corresponding annotation nodes, in case of forward references.

Overrides:
getAnnotationTagBits in class Binding
See Also:
Binding.getAnnotationTagBits()

getDefaultValue

public java.lang.Object getDefaultValue()
Returns:
the default value for this annotation method or null if there is no default value

getTypeVariable

public TypeVariableBinding getTypeVariable(char[] variableName)

hasSubstitutedParameters

public boolean hasSubstitutedParameters()
Returns true if method got substituted parameter types (see ParameterizedMethodBinding)


hasSubstitutedReturnType

public boolean hasSubstitutedReturnType()

isAbstract

public final boolean isAbstract()

isBridge

public final boolean isBridge()

isConstructor

public final boolean isConstructor()

isDefault

public final boolean isDefault()

isDefaultAbstract

public final boolean isDefaultAbstract()

isDeprecated

public final boolean isDeprecated()

isFinal

public final boolean isFinal()

isImplementing

public final boolean isImplementing()

isNative

public final boolean isNative()

isOverriding

public final boolean isOverriding()

isMain

public final boolean isMain()

isPrivate

public final boolean isPrivate()

isUsed

public final boolean isUsed()

isProtected

public final boolean isProtected()

isPublic

public final boolean isPublic()

isStatic

public final boolean isStatic()

isStrictfp

public final boolean isStrictfp()

isSynchronized

public final boolean isSynchronized()

isSynthetic

public final boolean isSynthetic()

isVarargs

public final boolean isVarargs()

isViewedAsDeprecated

public final boolean isViewedAsDeprecated()

original

public MethodBinding original()
Returns the original method (as opposed to parameterized instances)


readableName

public char[] readableName()
Specified by:
readableName in class Binding

setAnnotations

public void setAnnotations(AnnotationBinding[] annotations)

setAnnotations

public void setAnnotations(AnnotationBinding[] annotations,
                           AnnotationBinding[][] parameterAnnotations,
                           java.lang.Object defaultValue)

setDefaultValue

public void setDefaultValue(java.lang.Object defaultValue)

setParameterAnnotations

public void setParameterAnnotations(AnnotationBinding[][] parameterAnnotations)

shortReadableName

public char[] shortReadableName()
Overrides:
shortReadableName in class Binding
See Also:
Binding.shortReadableName()

setSelector

protected final void setSelector(char[] selector)

signature

public final char[] signature()

sourceEnd

public final int sourceEnd()

sourceMethod

public AbstractMethodDeclaration sourceMethod()

sourceStart

public final int sourceStart()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

tiebreakMethod

public MethodBinding tiebreakMethod()
Returns the method to use during tiebreak (usually the method itself). For generic method invocations, tiebreak needs to use generic method with erasure substitutes.


typeVariables

public TypeVariableBinding[] typeVariables()