Package proguard.classfile
Class Signature
java.lang.Object
proguard.classfile.Signature
- All Implemented Interfaces:
Comparable<Signature>
- Direct Known Subclasses:
ClassSignature,FieldSignature,MethodSignature
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).
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Stringprotected abstract Stringstatic voidClear the signature caches of allSignaturesubclasses.intstatic SignaturecomputeIfAbsent(Clazz clazz, Member member) This factory uses the caching features provided byMethodSignature.computeIfAbsent(Clazz, Method),FieldSignature.computeIfAbsent(Clazz, Field)andClassSignature.computeIfAbsent(Clazz).booleangetFqn()Deprecated.@Nullable ClazzReturns theClazzreference corresponding to the class returned bygetClassName()ornullif no reference is available (e.g.inthashCode()abstract booleanCheck if this signature is missing information.static SignatureConvenience factory that takes anyMemberand generates the appropriate signature, i.e.static voidsetCacheEnabled(boolean cacheEnabled) Enable or disable automatic caching inof(Clazz, Member).toString()
-
Field Details
-
fqn
-
prettyFqn
-
className
-
hashCode
protected final int hashCode -
referencedClass
-
-
Constructor Details
-
Signature
-
-
Method Details
-
isIncomplete
public abstract boolean isIncomplete()Check if this signature is missing information. -
of
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.- Parameters:
clazz- The class containing the membermember- The target member- Returns:
- The corresponding
Signatureobject
-
computeIfAbsent
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.- Parameters:
clazz- The class containing the membermember- The target member- Returns:
- 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
-
getPrettyFqn
-
getPackageName
Deprecated. -
getExternalPackageName
- Returns:
- the external package name (e.g., `java.lang` for `java.lang.Object`)
-
getClassName
-
calculateFqn
-
calculatePrettyFqn
-
getReferencedClass
Returns theClazzreference corresponding to the class returned bygetClassName()ornullif no reference is available (e.g. class is missing from the class pool). -
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<Signature>
-
toString
-