Package edu.umd.cs.findbugs.classfile
Class ClassDescriptor
java.lang.Object
edu.umd.cs.findbugs.classfile.ClassDescriptor
- All Implemented Interfaces:
Serializable
,Comparable<ClassDescriptor>
- Direct Known Subclasses:
ClassNameAndSuperclassInfo
Descriptor identifying a class.
- Author:
- David Hovemeyer
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
static ClassDescriptor
createClassDescriptor
(String className) Deprecated.static ClassDescriptor[]
createClassDescriptor
(String[] classNames) Deprecated.static ClassDescriptor
createClassDescriptor
(org.apache.bcel.classfile.JavaClass c) Deprecated.static ClassDescriptor
createClassDescriptorFromDottedClassName
(String dottedClassName) Deprecated.static ClassDescriptor
createClassDescriptorFromSignature
(String signature) Deprecated.final boolean
static ClassDescriptor
fromFieldSignature
(String signature) Deprecated.static ClassDescriptor
fromResourceName
(String resourceName) Deprecated.final String
Get the name of the class in dotted format.Get the name of the package in dotted format.Get the simple name of the classint
hashCode()
boolean
boolean
isArray()
static boolean
isClassResource
(String resourceName) Deprecated.UseDescriptorFactory.isClassResource(String)
insteadboolean
static void
throwClassNotFoundException
(ClassDescriptor classDescriptor) Throw a ClassNotFoundException to indicate that class named by given ClassDescriptor cannot be found.Deprecated.usegetDottedClassName()
instead.Get the resource name of this class as it would appear in the classpath.toString()
-
Field Details
-
EMPTY_ARRAY
-
-
Constructor Details
-
ClassDescriptor
Constructor.- Parameters:
className
- class name in VM format, e.g. "java/lang/String"
-
-
Method Details
-
getClassName
- Returns:
- Returns the class name in VM format, e.g. "java/lang/String"
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ClassDescriptor>
-
matches
-
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.usegetDottedClassName()
instead.Get the name of the class in dotted format.- Returns:
- the name of the class in dotted format
-
getDottedClassName
Get the name of the class in dotted format.- Returns:
- the name of the class in dotted format
-
getXClass
- Throws:
CheckedAnalysisException
-
getPackageName
Get the name of the package in dotted format.- Returns:
- the name of the package in dotted format
-
getSimpleName
Get the simple name of the class- Returns:
- the simple name of the class
-
getSignature
-
isArray
public boolean isArray() -
fromResourceName
Deprecated.Create a class descriptor from a resource name.- Parameters:
resourceName
- the resource name- Returns:
- the class descriptor
-
fromFieldSignature
Deprecated.Create a class descriptor from a field signature -
isClassResource
Deprecated.UseDescriptorFactory.isClassResource(String)
insteadDetermine whether or not the given resource name refers to a class.- Parameters:
resourceName
- the resource name- Returns:
- true if the resource is a class, false otherwise
-
createClassDescriptorFromSignature
Deprecated. -
createClassDescriptor
Deprecated.UseDescriptorFactory.createClassDescriptor(String)
instead -
createClassDescriptor
Deprecated. -
createClassDescriptorFromDottedClassName
@Deprecated public static ClassDescriptor createClassDescriptorFromDottedClassName(String dottedClassName) Deprecated. -
createClassDescriptor
@Deprecated public static ClassDescriptor createClassDescriptor(org.apache.bcel.classfile.JavaClass c) Deprecated. -
toString
-
equals
-
hashCode
public int hashCode() -
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()
-
DescriptorFactory.createClassDescriptor(String)
instead