Class Signature

  • All Implemented Interfaces:
    java.lang.Comparable<Signature>
    Direct Known Subclasses:
    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).
    • Field Detail

      • 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
        The Clazz that the className references. May be null if there is no reference available (e.g. class is missing from the class pool).
    • Constructor Detail

      • Signature

        protected Signature​(java.lang.String internalClassName,
                            int hashCode)
    • Method Detail

      • isIncomplete

        public abstract boolean isIncomplete()
        Check if this signature is missing information.
      • clearCache

        public static void clearCache()
        Clear the signature caches of all Signature subclasses.
      • setCacheEnabled

        public static void setCacheEnabled​(boolean cacheEnabled)
        Enable or disable automatic caching in of(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()
        Deprecated.
      • getExternalPackageName

        public java.lang.String getExternalPackageName()
        Returns:
        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 the Clazz reference corresponding to the class returned by getClassName() or null if no reference is available (e.g. class is missing from the class pool).
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • compareTo

        public int compareTo​(Signature o)
        Specified by:
        compareTo in interface java.lang.Comparable<Signature>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object