Class MethodBinding
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding
- Direct Known Subclasses:
InterTypeMethodBinding,MostSpecificExceptionMethodBinding,ParameterizedMethodBinding,PolymorphicMethodBinding,ProblemMethodBinding,SyntheticFactoryMethodBinding,SyntheticMethodBinding
-
Field Summary
FieldsModifier and TypeFieldDescriptionintintchar[][]Store parameter names from MethodParameters attribute (incl. applicable default).Boolean[]Store nullness information from annotation (incl. applicable default).char[]longprotected AnnotationBinding[]Fields inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding
ANY_EXCEPTION, ARRAY_TYPE, BASE_TYPE, DefaultLocationArrayContents, DefaultLocationField, DefaultLocationParameter, DefaultLocationReturnType, DefaultLocationsForTrueValue, DefaultLocationTypeArgument, DefaultLocationTypeBound, DefaultLocationTypeParameter, FIELD, GENERIC_TYPE, IMPORT, INTERSECTION_TYPE, INTERSECTION_TYPE18, LOCAL, METHOD, MODULE, NO_ANNOTATIONS, NO_COMPONENTS, NO_ELEMENT_VALUE_PAIRS, NO_EXCEPTIONS, NO_FIELDS, NO_MEMBER_TYPES, NO_METHODS, NO_MODULES, NO_NULL_DEFAULT, NO_PACKAGES, NO_PARAMETER_NAMES, NO_PARAMETERS, NO_PERMITTEDTYPES, NO_PLAIN_PACKAGES, NO_REFERENCE_TYPES, NO_SUPERINTERFACES, NO_TYPE_VARIABLES, NO_TYPES, NULL_UNSPECIFIED_BY_DEFAULT, NullnessDefaultMASK, PACKAGE, PARAMETERIZED_TYPE, PATTERN, POLY_TYPE, RAW_TYPE, RECORD_COMPONENT, TYPE, TYPE_PARAMETER, TYPE_USE, UNINITIALIZED_COMPONENTS, UNINITIALIZED_FIELDS, UNINITIALIZED_METHODS, UNINITIALIZED_REFERENCE_TYPES, VARIABLE, WILDCARD_TYPE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMethodBinding(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
Modifier and TypeMethodDescriptionbooleanSubtypes can override this to return true if an access method should be used when referring to this method binding.final booleanfinal booleanareParametersCompatibleWith(TypeBinding[] arguments) final booleanareParametersEqual(MethodBinding method) final booleanbooleancanBeSeenBy(InvocationSite invocationSite, Scope scope) final booleancanBeSeenBy(PackageBinding invocationPackage) booleancanBeSeenBy(TypeBinding receiverType, InvocationSite invocationSite, Scope scope) collectMissingTypes(List<TypeBinding> missingTypes) computeSubstitutedMethod(MethodBinding method, LookupEnvironment env) char[]computeUniqueKey(boolean isLeaf) final char[]booleandoesParameterLengthMatch(int suggestedParameterLength) protected voidfillInDefaultNonNullness(AbstractMethodDeclaration sourceMethod, boolean needToApplyReturnNonNullDefault, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterNonNullDefaultProvider needToApplyParameterNonNullDefault) After method verifier has finished, fill in missing @NonNull specification from the applicable default.protected voidfillInDefaultNonNullness18(AbstractMethodDeclaration sourceMethod, LookupEnvironment env) findOriginalInheritedMethod(MethodBinding inheritedMethod) findPrivilegedBinding(SourceTypeBinding invocationType, InvocationSite location) char[]<typeParam1 ... typeParamM>(param1 ... paramN)returnType thrownException1 ... thrownExceptionP T foo(T t) throws X---> (TT;)TT;LX<TT;>; void bar(X t) --> (LX<TT;>;)V void bar(X t) --> <T:Ljava.lang.Object;>(LX<TT;>;)V final intgetAccessMethod(boolean staticReference) This will only be called if alwaysNeedsAccessMethod() returns true.getAllTypeVariables(boolean isDiamond) longCompute the tagbits for standard annotations.final AnnotationBinding[]getTypeVariable(char[] variableName) getVisibleBinding(InvocationSite invocationSite, Scope scope) getVisibleBinding(TypeBinding receiverType, InvocationSite invocationSite, Scope scope) org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterNonNullDefaultProviderbooleanbooleanReturns true if method got substituted parameter types (see ParameterizedMethodBinding)booleanfinal booleanfinal booleanisBridge()final booleanfinal booleanfinal booleanfinal booleanbooleanfinal booleanbooleanisFinal()final booleanfinal booleanisMain()final booleanisNative()final booleanfinal booleanbooleanbooleanfinal booleanfinal booleanfinal booleanisPublic()final booleanisStatic()final booleanfinal booleanfinal booleanfinal booleanisUsed()booleanfinal booleanbooleanfinal intkind()original()Returns the original method (as opposed to parameterized/polymorphic instances)char[]booleanvoidsetAnnotations(AnnotationBinding[] annotations, boolean forceStore) voidsetAnnotations(AnnotationBinding[] annotations, AnnotationBinding[][] parameterAnnotations, Object defaultValue, LookupEnvironment optionalEnv) voidsetDefaultValue(Object defaultValue) voidsetParameterAnnotations(AnnotationBinding[][] parameterAnnotations) protected final voidsetSelector(char[] selector) voidsetTypeAnnotations(AnnotationBinding[] annotations) Strips one level of parameterization, so if both class & method are parameterized, leave the class parameters in place.char[]final char[]char[]final intfinal intReturns the method to use during tiebreak (usually the method itself).toString()voidupdateTypeVariableBinding(TypeVariableBinding previousBinding, TypeVariableBinding updatedBinding) Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding
computeUniqueKey, initializeDeprecatedAnnotationTagBits, isAnnotationType, isParameter, isTaggedRepeatable, isValid, isValidBinding, isVolatile, problemId, setAnnotations
-
Field Details
-
modifiers
public int modifiers -
selector
public char[] selector -
returnType
-
parameters
-
receiver
-
thrownExceptions
-
declaringClass
-
typeVariables
-
tagBits
public long tagBits -
typeAnnotations
-
parameterNonNullness
Store nullness information from annotation (incl. applicable default). -
defaultNullness
public int defaultNullness -
parameterNames
public char[][] parameterNamesStore parameter names from MethodParameters attribute (incl. applicable default).
-
-
Constructor Details
-
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
-
-
Method Details
-
areParameterErasuresEqual
-
areParametersCompatibleWith
-
areParametersEqual
-
areTypeVariableErasuresEqual
-
asRawMethod
-
canBeSeenBy
-
getVisibleBinding
public MethodBinding getVisibleBinding(TypeBinding receiverType, InvocationSite invocationSite, Scope scope) -
getVisibleBinding
-
findPrivilegedBinding
public MethodBinding findPrivilegedBinding(SourceTypeBinding invocationType, InvocationSite location) -
canBeSeenBy
-
canBeSeenBy
-
collectMissingTypes
-
computeSubstitutedMethod
-
computeUniqueKey
public char[] computeUniqueKey(boolean isLeaf) - Overrides:
computeUniqueKeyin classBinding
-
constantPoolName
public final char[] constantPoolName() -
fillInDefaultNonNullness
protected void fillInDefaultNonNullness(AbstractMethodDeclaration sourceMethod, boolean needToApplyReturnNonNullDefault, org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterNonNullDefaultProvider needToApplyParameterNonNullDefault) After method verifier has finished, fill in missing @NonNull specification from the applicable default.- Parameters:
needToApplyParameterNonNullDefault-needToApplyReturnNonNullDefault-
-
fillInDefaultNonNullness18
protected void fillInDefaultNonNullness18(AbstractMethodDeclaration sourceMethod, LookupEnvironment env) -
findOriginalInheritedMethod
-
genericSignature
public char[] genericSignature()<typeParam1 ... typeParamM>(param1 ... paramN)returnType thrownException1 ... thrownExceptionP T foo(T t) throws X
---> (TT;)TT;LX<TT;>; void bar(X t) --> (LX<TT;>;)V void bar(X t) --> <T:Ljava.lang.Object;>(LX<TT;>;)V -
getAccessFlags
public final int getAccessFlags() -
getAnnotations
- Overrides:
getAnnotationsin classBinding
-
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:
getAnnotationTagBitsin classBinding- See Also:
-
getDefaultValue
- Returns:
- the default value for this annotation method or
nullif there is no default value
-
getParameterAnnotations
- Returns:
- the annotations for each of the method parameters or
null>if there's no parameter or no annotation at all.
-
getTypeVariable
-
getAllTypeVariables
-
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() -
isCompactConstructor
public final boolean isCompactConstructor() -
isDefault
public final boolean isDefault() -
isDefaultAbstract
public final boolean isDefaultAbstract() -
isDefaultMethod
public boolean isDefaultMethod() -
isDeprecated
public final boolean isDeprecated() -
isFinal
public 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() -
isParameterizedGeneric
public boolean isParameterizedGeneric() -
isPolymorphic
public boolean isPolymorphic() -
isViewedAsDeprecated
public final boolean isViewedAsDeprecated() -
kind
public final int kind() -
original
Returns the original method (as opposed to parameterized/polymorphic instances) -
shallowOriginal
Strips one level of parameterization, so if both class & method are parameterized, leave the class parameters in place. -
genericMethod
-
readableName
public char[] readableName()- Specified by:
readableNamein classBinding
-
getTypeAnnotations
-
setTypeAnnotations
-
setAnnotations
- Overrides:
setAnnotationsin classBinding
-
setAnnotations
public void setAnnotations(AnnotationBinding[] annotations, AnnotationBinding[][] parameterAnnotations, Object defaultValue, LookupEnvironment optionalEnv) -
setDefaultValue
-
setParameterAnnotations
-
setSelector
protected final void setSelector(char[] selector) -
shortReadableName
public char[] shortReadableName()- Overrides:
shortReadableNamein classBinding- See Also:
-
signature
public final char[] signature() -
signature
-
sourceEnd
public final int sourceEnd() -
sourceMethod
-
sourceLambda
-
sourceRecordComponent
-
sourceStart
public final int sourceStart() -
alwaysNeedsAccessMethod
public boolean alwaysNeedsAccessMethod()Subtypes can override this to return true if an access method should be used when referring to this method binding. Currently used for AspectJ's inter-type method declarations. -
getAccessMethod
This will only be called if alwaysNeedsAccessMethod() returns true. In that case it should return the access method to be used. -
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
-
typeVariables
-
hasNonNullDefaultForReturnType
-
hasNonNullDefaultForParameter
public org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterNonNullDefaultProvider hasNonNullDefaultForParameter(AbstractMethodDeclaration srcMethod) -
redeclaresPublicObjectMethod
-
isVoidMethod
public boolean isVoidMethod() -
doesParameterLengthMatch
public boolean doesParameterLengthMatch(int suggestedParameterLength) -
updateTypeVariableBinding
public void updateTypeVariableBinding(TypeVariableBinding previousBinding, TypeVariableBinding updatedBinding)
-