类 MethodSignature
java.lang.Object
proguard.classfile.Signature
proguard.classfile.MethodSignature
- 所有已实现的接口:
Comparable<Signature>,MethodInfo
Represents a Method signature containing a class, method and a descriptor.
In order to avoid a huge blow-up in memory consumption for analyses that rely heavily on
method signatures, e.g. the creation of a call graph, this class provides the ability to cache
signatures belonging to concrete Method objects. By using the corresponding computeIfAbsent(Clazz, Method) method, the amount of strings that need to be retained during
runtime is reduced.
-
字段概要
字段 -
构造器概要
构造器构造器说明MethodSignature(@NotNull Clazz clazz) MethodSignature(@NotNull Clazz clazz, @NotNull Method method) MethodSignature(@Nullable String className) MethodSignature(@Nullable String internalClassName, @Nullable String method, @Nullable String descriptor) MethodSignature(@Nullable String internalClassName, @Nullable String method, @Nullable MethodDescriptor descriptor) -
方法概要
修饰符和类型方法说明protected Stringprotected Stringstatic voidRemove all currently cachedMethodSignatureobjects from the cache, allowing them to be removed by the garbage collector.static MethodSignaturecomputeIfAbsent(Clazz clazz, Method method) Get the singletonMethodSignatureobject for this specificMethod.boolean@Nullable MethodDescriptorReturns the method's descriptor.@Nullable StringReturns the method's name.Returns theMethodreference that corresponds to the method represented by thisMethodSignatureornullif no reference is available (e.g. the methhod or its class were missing).booleanCheck if this signature is missing information.static booleanmatchesIgnoreNull(MethodSignature signature, MethodSignature wildcard) Fuzzy check if twoMethodSignatureobjects are equal.static booleanmatchesIgnoreNullAndDollar(MethodSignature signature, MethodSignature wildcard) Fuzzy check likematchesIgnoreNull(MethodSignature, MethodSignature)but allows dollar signs in type strings.从类继承的方法 proguard.classfile.Signature
compareTo, computeIfAbsent, getClassName, getExternalPackageName, getFqn, getPackageName, getPrettyFqn, getReferencedClass, hashCode, of, setCacheEnabled, toString
-
字段详细资料
-
UNKNOWN
-
method
-
descriptor
-
-
构造器详细资料
-
MethodSignature
public MethodSignature(@Nullable @Nullable String internalClassName, @Nullable @Nullable String method, @Nullable @Nullable MethodDescriptor descriptor) -
MethodSignature
-
MethodSignature
-
MethodSignature
-
MethodSignature
-
-
方法详细资料
-
getReferencedMethod
Returns theMethodreference that corresponds to the method represented by thisMethodSignatureornullif no reference is available (e.g. the methhod or its class were missing). -
computeIfAbsent
Get the singletonMethodSignatureobject for this specificMethod. If it is not yet available in the cache, it will be newly instantiated.- 参数:
clazz- The class containing the target methodmethod- The method whose signature is to be generated- 返回:
- The cached or newly generated
MethodSignatureobject
-
isIncomplete
public boolean isIncomplete()从类复制的说明:SignatureCheck if this signature is missing information.- 指定者:
isIncomplete在类中Signature
-
calculateFqn
- 指定者:
calculateFqn在类中Signature
-
calculatePrettyFqn
- 指定者:
calculatePrettyFqn在类中Signature
-
clearCache
public static void clearCache()Remove all currently cachedMethodSignatureobjects from the cache, allowing them to be removed by the garbage collector. -
matchesIgnoreNull
Fuzzy check if twoMethodSignatureobjects are equal. If any pattern field is null, its value in the matched object does not influence the check result, providing a way to create a wildcardMethodSignaturethat e.g. matches several methods of a class that have the same name but a differentMethodDescriptor.- 参数:
signature- TheMethodSignatureto be comparedwildcard- TheMethodSignaturepattern to be matched against- 返回:
- true if the two objects match
-
matchesIgnoreNullAndDollar
public static boolean matchesIgnoreNullAndDollar(MethodSignature signature, MethodSignature wildcard) Fuzzy check likematchesIgnoreNull(MethodSignature, MethodSignature)but allows dollar signs in type strings. Usually the notation for inner classes iscom/example/Foo$Bar, but sometimes external systems call this classcom/example/Foo/Bar. These two names correspond to the same class and thus should be treated as the same if they appear in aMethodSignature. If it is to be expected that this situation may occur, this method should be preferred overmatchesIgnoreNull(MethodSignature, MethodSignature)to avoid false negatives.- 参数:
signature- TheMethodSignatureto be comparedwildcard- TheMethodSignaturepattern to be matched against- 返回:
- true if the two objects match
-
equals
-
getMethodName
从接口复制的说明:MethodInfoReturns the method's name.- 指定者:
getMethodName在接口中MethodInfo
-
getDescriptor
从接口复制的说明:MethodInfoReturns the method's descriptor.- 指定者:
getDescriptor在接口中MethodInfo
-