Class ClassDescriptor

java.lang.Object
edu.umd.cs.findbugs.classfile.ClassDescriptor
All Implemented Interfaces:
Serializable, Comparable<ClassDescriptor>
Direct Known Subclasses:
ClassNameAndSuperclassInfo

public class ClassDescriptor extends Object implements Comparable<ClassDescriptor>, Serializable
Descriptor identifying a class.
See Also:
  • Field Details

  • Constructor Details

    • ClassDescriptor

      protected ClassDescriptor(@SlashedClassName String className)
      Constructor.
      Parameters:
      className - class name in VM format, e.g. "java/lang/String"
  • Method Details

    • getClassName

      @SlashedClassName public final String getClassName()
      Returns:
      Returns the class name in VM format, e.g. "java/lang/String"
    • compareTo

      public int compareTo(ClassDescriptor o)
      Specified by:
      compareTo in interface Comparable<ClassDescriptor>
    • matches

      public boolean matches(Class<?> c)
    • toResourceName

      public String toResourceName()
      Get the resource name of this class as it would appear in the classpath. E.g., "java/lang/String.class"
      Returns:
      the resource name
    • toDottedClassName

      @Deprecated @DottedClassName public String toDottedClassName()
      Deprecated.
      Get the name of the class in dotted format.
      Returns:
      the name of the class in dotted format
    • getDottedClassName

      @DottedClassName public String getDottedClassName()
      Get the name of the class in dotted format.
      Returns:
      the name of the class in dotted format
    • getXClass

      public XClass getXClass() throws CheckedAnalysisException
      Throws:
      CheckedAnalysisException
    • getPackageName

      @DottedClassName public String getPackageName()
      Get the name of the package in dotted format.
      Returns:
      the name of the package in dotted format
    • getSimpleName

      public String getSimpleName()
      Get the simple name of the class
      Returns:
      the simple name of the class
    • getSignature

      public String getSignature()
    • isArray

      public boolean isArray()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • throwClassNotFoundException

      public static void throwClassNotFoundException(ClassDescriptor classDescriptor) throws ClassNotFoundException
      Throw a ClassNotFoundException to indicate that class named by given ClassDescriptor cannot be found. The exception message is formatted in a way that can be decoded by ClassNotFoundExceptionParser.
      Parameters:
      classDescriptor - ClassDescriptor naming a class that cannot be found
      Throws:
      ClassNotFoundException
      See Also:
    • isAnonymousClass

      public boolean isAnonymousClass()