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
Direct Known Subclasses:
MostSpecificExceptionMethodBinding, ParameterizedMethodBinding, PolymorphicMethodBinding, ProblemMethodBinding, SyntheticMethodBinding

public class MethodBinding
extends Binding


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, INTERSECTION_TYPE, 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, UNINITIALIZED_FIELDS, UNINITIALIZED_METHODS, UNINITIALIZED_REFERENCE_TYPES, VARIABLE, WILDCARD_TYPE
 
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)
           
 List collectMissingTypes(List missingTypes)
           
 char[] computeUniqueKey(boolean isLeaf)
           
 char[] constantPoolName()
           
 MethodBinding findOriginalInheritedMethod(MethodBinding inheritedMethod)
           
 char[] genericSignature()
          
 int getAccessFlags()
           
 AnnotationBinding[] getAnnotations()
           
 long getAnnotationTagBits()
          Compute the tagbits for standard annotations.
 Object getDefaultValue()
           
 AnnotationBinding[][] getParameterAnnotations()
           
 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 isOrEnclosedByPrivateType()
           
 boolean isOverriding()
           
 boolean isPolymorphic()
           
 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/polymorphic instances)
 char[] readableName()
           
 void setAnnotations(AnnotationBinding[] annotations)
           
 void setAnnotations(AnnotationBinding[] annotations, AnnotationBinding[][] parameterAnnotations, Object defaultValue, LookupEnvironment optionalEnv)
           
 void setDefaultValue(Object defaultValue)
           
 void setParameterAnnotations(AnnotationBinding[][] parameterAnnotations)
           
protected  void setSelector(char[] selector)
           
 char[] shortReadableName()
           
 char[] signature()
           
 char[] signature(ClassFile classFile)
           
 int sourceEnd()
           
 AbstractMethodDeclaration sourceMethod()
           
 int sourceStart()
           
 MethodBinding tiebreakMethod()
          Returns the method to use during tiebreak (usually the method itself).
 String toString()
           
 TypeVariableBinding[] typeVariables()
           
 
Methods inherited from class org.eclipse.jdt.internal.compiler.lookup.Binding
computeUniqueKey, initializeDeprecatedAnnotationTagBits, isParameter, isValidBinding, isVolatile, 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)

areParametersCompatibleWith

public final boolean areParametersCompatibleWith(TypeBinding[] arguments)

areParametersEqual

public final boolean areParametersEqual(MethodBinding method)

areTypeVariableErasuresEqual

public final boolean areTypeVariableErasuresEqual(MethodBinding method)

canBeSeenBy

public final boolean canBeSeenBy(InvocationSite invocationSite,
                                 Scope scope)

canBeSeenBy

public final boolean canBeSeenBy(PackageBinding invocationPackage)

canBeSeenBy

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

collectMissingTypes

public List collectMissingTypes(List missingTypes)

computeUniqueKey

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

constantPoolName

public final char[] constantPoolName()

findOriginalInheritedMethod

public MethodBinding findOriginalInheritedMethod(MethodBinding inheritedMethod)

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
 


getAccessFlags

public final int getAccessFlags()

getAnnotations

public AnnotationBinding[] getAnnotations()

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 Object getDefaultValue()
Returns:
the default value for this annotation method or null if there is no default value

getParameterAnnotations

public AnnotationBinding[][] getParameterAnnotations()
Returns:
the annotations for each of the method parameters or null> if there's no parameter or no annotation at all.

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()

isMain

public final boolean isMain()

isNative

public final boolean isNative()

isOverriding

public final boolean isOverriding()

isPrivate

public final boolean isPrivate()

isOrEnclosedByPrivateType

public final boolean isOrEnclosedByPrivateType()

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()

isUsed

public final boolean isUsed()

isVarargs

public boolean isVarargs()

isPolymorphic

public boolean isPolymorphic()

isViewedAsDeprecated

public final boolean isViewedAsDeprecated()

kind

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

original

public MethodBinding original()
Returns the original method (as opposed to parameterized/polymorphic 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,
                           Object defaultValue,
                           LookupEnvironment optionalEnv)

setDefaultValue

public void setDefaultValue(Object defaultValue)

setParameterAnnotations

public void setParameterAnnotations(AnnotationBinding[][] parameterAnnotations)

setSelector

protected final void setSelector(char[] selector)

shortReadableName

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

signature

public final char[] signature()

signature

public final char[] signature(ClassFile classFile)

sourceEnd

public final int sourceEnd()

sourceMethod

public AbstractMethodDeclaration sourceMethod()

sourceStart

public final int sourceStart()

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.


toString

public String toString()
Overrides:
toString in class Object

typeVariables

public TypeVariableBinding[] typeVariables()


Copyright © 2012. All Rights Reserved.