Class MethodBinding
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding
-
Field Summary
FieldsModifier and TypeFieldDescriptionintintintstatic bytestatic bytestatic bytestatic bytestatic bytestatic bytebyte[]Store flow-related information from declaration annotations (nullness and owning) (incl.char[][]Store parameter names from MethodParameters attribute (incl.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_PERMITTED_TYPES, 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, boolean considerReturnType) final char[]computeSignature(ClassFile classFile) 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) static byteflowBitFromAnnotationTagBit(long tagBit) char[]<typeParam1 ... typeParamM>(param1 ... paramN)returnType thrownException1 ... thrownExceptionP T foo(T t) throws X<T> ---> (TT;)TT;LX<TT;>; void bar(X<T> t) --> (LX<TT;>;)V <T> void bar(X<T> t) --> <T:Ljava.lang.Object;>(LX<TT;>;)Vfinal intgetAccessMethod(boolean staticReference) This will only be called if alwaysNeedsAccessMethod() returns true.getAllTypeVariables(boolean isDiamond) longCompute the tagbits for standard annotations.getParameterNullness(int idx) 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.ParameterNonNullDefaultProviderbooleanbooleanhasPolymorphicSignature(Scope scope) Identifies whether the method has Polymorphic signature based on jls-15.12.3
Definition reproduced here.booleanReturns true if method got substituted parameter types (see ParameterizedMethodBinding)booleanfinal booleanfinal booleanisBridge()final booleanfinal booleanbooleanfinal booleanfinal booleanfinal booleanfinal booleanbooleanfinal booleanbooleanisFinal()final booleanfinal booleanfinal booleanisMain()final booleanisNative()final booleanfinal booleanbooleanbooleanfinal booleanfinal booleanfinal booleanisPublic()final booleanisStatic()final booleanfinal booleanfinal booleanfinal booleanisUsed()booleanfinal booleanbooleanbooleanisWellknownMethod(char[][] compoundClassName, char[] wellKnownSelector) booleanisWellknownMethod(int typeId, char[] wellKnownSelector) final intkind()voidmarkMissingOwningAnnotationOnParameter(int rank) booleannotownsParameter(int i) original()Returns the original method (as opposed to parameterized/polymorphic instances)booleanownsParameter(int i) booleanparameterHasMissingOwningAnnotation(int rank) 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 and 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) voidverifyOverrideCompatibility(MethodBinding inheritedMethod, ClassScope scope) Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding
computeUniqueKey, initializeDeprecatedAnnotationTagBits, isAnnotationType, isParameter, isPatternVariable, 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 -
extendedTagBits
public int extendedTagBits -
binaryPreviewAnnotation
-
typeAnnotations
-
defaultNullness
public int defaultNullness -
parameterFlowBits
public byte[] parameterFlowBitsStore flow-related information from declaration annotations (nullness and owning) (incl. applicable default). -
PARAM_NONNULL
public static byte PARAM_NONNULL -
PARAM_NULLABLE
public static byte PARAM_NULLABLE -
PARAM_NULLITY
public static byte PARAM_NULLITY -
PARAM_OWNING
public static byte PARAM_OWNING -
PARAM_NOTOWNING
public static byte PARAM_NOTOWNING -
PARAM_MISSING_OWNING_ANN
public static byte PARAM_MISSING_OWNING_ANN -
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
-
flowBitFromAnnotationTagBit
public static byte flowBitFromAnnotationTagBit(long tagBit) -
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
public List<TypeBinding> collectMissingTypes(List<TypeBinding> missingTypes, boolean considerReturnType) -
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. -
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<T> ---> (TT;)TT;LX<TT;>; void bar(X<T> t) --> (LX<TT;>;)V <T> void bar(X<T> 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() -
isCanonicalConstructor
public final boolean isCanonicalConstructor() -
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() -
isImplicit
public final boolean isImplicit() -
isMain
public final boolean isMain() -
isCandindateMain
public final boolean isCandindateMain() -
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
-
original
Returns the original method (as opposed to parameterized/polymorphic instances) -
shallowOriginal
Strips one level of parameterization, so if both class and 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() -
computeSignature
-
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) -
hasPolymorphicSignature
Identifies whether the method has Polymorphic signature based on jls-15.12.3
Definition reproduced here.
A method is signature polymorphic if all of the following are true:- It is declared in the java.lang.invoke.MethodHandle class or the java.lang.invoke.VarHandle class.
- It has a single variable arity parameter (§8.4.1) whose declared type is Object[].
- It is native.
- Returns:
- true if the method has Polymorphic Signature
-
isClosingMethod
public boolean isClosingMethod() -
ownsParameter
public boolean ownsParameter(int i) -
notownsParameter
public boolean notownsParameter(int i) -
parameterHasMissingOwningAnnotation
public boolean parameterHasMissingOwningAnnotation(int rank) -
markMissingOwningAnnotationOnParameter
public void markMissingOwningAnnotationOnParameter(int rank) -
getParameterNullness
- Returns:
- TRUE means @NonNull declared, FALSE means @Nullable declared, null means nothing declared
-
verifyOverrideCompatibility
-
isWellknownMethod
public boolean isWellknownMethod(char[][] compoundClassName, char[] wellKnownSelector) -
isWellknownMethod
public boolean isWellknownMethod(int typeId, char[] wellKnownSelector)
-