类 Signature
- java.lang.Object
-
- proguard.classfile.Signature
-
- 所有已实现的接口:
java.lang.Comparable<Signature>
- 直接已知子类:
ClassSignature,FieldSignature,MethodSignature
public abstract class Signature extends java.lang.Object implements java.lang.Comparable<Signature>
A signature currently can be a Method- or a FieldSignature. This class can be used to create the correct one from a ProguardCORE member object (which can also be a method or a field).
-
-
构造器概要
构造器 限定符 构造器 说明 protectedSignature(java.lang.String internalClassName, int hashCode)
-
方法概要
所有方法 静态方法 实例方法 抽象方法 具体方法 已过时的方法 修饰符和类型 方法 说明 protected abstract java.lang.StringcalculateFqn()protected abstract java.lang.StringcalculatePrettyFqn()static voidclearCache()Clear the signature caches of allSignaturesubclasses.intcompareTo(Signature o)static SignaturecomputeIfAbsent(Clazz clazz, Member member)This factory uses the caching features provided byMethodSignature.computeIfAbsent(Clazz, Method),FieldSignature.computeIfAbsent(Clazz, Field)andClassSignature.computeIfAbsent(Clazz).booleanequals(java.lang.Object o)java.lang.StringgetClassName()java.lang.StringgetExternalPackageName()java.lang.StringgetFqn()java.lang.StringgetPackageName()已过时。java.lang.StringgetPrettyFqn()@Nullable ClazzgetReferencedClass()Returns theClazzreference corresponding to the class returned bygetClassName()ornullif no reference is available (e.g. class is missing from the class pool).inthashCode()abstract booleanisIncomplete()Check if this signature is missing information.static Signatureof(Clazz clazz, Member member)Convenience factory that takes anyMemberand generates the appropriate signature, i.e.static voidsetCacheEnabled(boolean cacheEnabled)Enable or disable automatic caching inof(Clazz, Member).java.lang.StringtoString()
-
-
-
字段详细资料
-
fqn
protected java.lang.String fqn
-
prettyFqn
protected java.lang.String prettyFqn
-
className
protected final java.lang.String className
-
hashCode
protected final int hashCode
-
referencedClass
@Nullable protected @Nullable Clazz referencedClass
-
-
方法详细资料
-
isIncomplete
public abstract boolean isIncomplete()
Check if this signature is missing information.
-
of
public static Signature of(Clazz clazz, Member member)
Convenience factory that takes anyMemberand generates the appropriate signature, i.e.MethodSignatures forMethods andFieldSignatures forFields. If the member is null, aClassSignatureis generated.Note that if
cacheEnabledis set to true, the generation process is delegated tocomputeIfAbsent(Clazz, Member)to make use of caching features.- 参数:
clazz- The class containing the membermember- The target member- 返回:
- The corresponding
Signatureobject
-
computeIfAbsent
public static Signature computeIfAbsent(Clazz clazz, Member member)
This factory uses the caching features provided byMethodSignature.computeIfAbsent(Clazz, Method),FieldSignature.computeIfAbsent(Clazz, Field)andClassSignature.computeIfAbsent(Clazz). Only one signature is created for each distinctMethod,FieldorClazz. If the same signature is requested several times, the previously created object will be returned.- 参数:
clazz- The class containing the membermember- The target member- 返回:
- The corresponding
Signatureobject
-
clearCache
public static void clearCache()
Clear the signature caches of allSignaturesubclasses.
-
setCacheEnabled
public static void setCacheEnabled(boolean cacheEnabled)
Enable or disable automatic caching inof(Clazz, Member). Existing caches are purged once caching has been disabled.
-
getFqn
public java.lang.String getFqn()
-
getPrettyFqn
public java.lang.String getPrettyFqn()
-
getPackageName
@Deprecated public java.lang.String getPackageName()
已过时。
-
getExternalPackageName
public java.lang.String getExternalPackageName()
- 返回:
- the external package name (e.g., `java.lang` for `java.lang.Object`)
-
getClassName
public java.lang.String getClassName()
-
calculateFqn
protected abstract java.lang.String calculateFqn()
-
calculatePrettyFqn
protected abstract java.lang.String calculatePrettyFqn()
-
getReferencedClass
@Nullable public @Nullable Clazz getReferencedClass()
Returns theClazzreference corresponding to the class returned bygetClassName()ornullif no reference is available (e.g. class is missing from the class pool).
-
equals
public boolean equals(java.lang.Object o)
- 覆盖:
equals在类中java.lang.Object
-
hashCode
public int hashCode()
- 覆盖:
hashCode在类中java.lang.Object
-
toString
public java.lang.String toString()
- 覆盖:
toString在类中java.lang.Object
-
-