Package edu.umd.cs.findbugs.classfile
Class ClassDescriptor
- java.lang.Object
-
- edu.umd.cs.findbugs.classfile.ClassDescriptor
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<ClassDescriptor>
- Direct Known Subclasses:
ClassNameAndSuperclassInfo
public class ClassDescriptor extends java.lang.Object implements java.lang.Comparable<ClassDescriptor>, java.io.Serializable
Descriptor identifying a class.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.regex.PatternANONYMOUS_CLASS_NAMEprivate java.lang.StringclassNamestatic ClassDescriptor[]EMPTY_ARRAYprivate static longserialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description protectedClassDescriptor(java.lang.String className)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intcompareTo(ClassDescriptor o)booleanequals(java.lang.Object obj)java.lang.StringgetClassName()java.lang.StringgetDottedClassName()Get the name of the class in dotted format.java.lang.StringgetPackageName()Get the name of the package in dotted format.java.lang.StringgetSignature()java.lang.StringgetSimpleName()Get the simple name of the classXClassgetXClass()inthashCode()booleanisAnonymousClass()booleanisArray()booleanmatches(java.lang.Class<?> c)static voidthrowClassNotFoundException(ClassDescriptor classDescriptor)Throw a ClassNotFoundException to indicate that class named by given ClassDescriptor cannot be found.java.lang.StringtoDottedClassName()Deprecated.usegetDottedClassName()instead.java.lang.StringtoResourceName()Get the resource name of this class as it would appear in the classpath.java.lang.StringtoString()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
className
@SlashedClassName private final java.lang.String className
-
ANONYMOUS_CLASS_NAME
private static final java.util.regex.Pattern ANONYMOUS_CLASS_NAME
-
EMPTY_ARRAY
public static final ClassDescriptor[] EMPTY_ARRAY
-
-
Constructor Detail
-
ClassDescriptor
protected ClassDescriptor(@SlashedClassName java.lang.String className)
Constructor.- Parameters:
className- class name in VM format, e.g. "java/lang/String"
-
-
Method Detail
-
getClassName
@SlashedClassName public final java.lang.String getClassName()
- Returns:
- Returns the class name in VM format, e.g. "java/lang/String"
-
compareTo
public int compareTo(ClassDescriptor o)
- Specified by:
compareToin interfacejava.lang.Comparable<ClassDescriptor>
-
matches
public boolean matches(java.lang.Class<?> c)
-
toResourceName
public java.lang.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 java.lang.String toDottedClassName()
Deprecated.usegetDottedClassName()instead.Get the name of the class in dotted format.- Returns:
- the name of the class in dotted format
-
getDottedClassName
@DottedClassName public java.lang.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 java.lang.String getPackageName()
Get the name of the package in dotted format.- Returns:
- the name of the package in dotted format
-
getSimpleName
public java.lang.String getSimpleName()
Get the simple name of the class- Returns:
- the simple name of the class
-
getSignature
public java.lang.String getSignature()
-
isArray
public boolean isArray()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public final boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
throwClassNotFoundException
public static void throwClassNotFoundException(ClassDescriptor classDescriptor) throws java.lang.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:
java.lang.ClassNotFoundException- See Also:
ClassNotFoundExceptionParser
-
isAnonymousClass
public boolean isAnonymousClass()
-
-