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 TypeMethodDescriptionintstatic ClassDescriptorcreateClassDescriptor(String className) Deprecated.static ClassDescriptor[]createClassDescriptor(String[] classNames) Deprecated.static ClassDescriptorcreateClassDescriptor(org.apache.bcel.classfile.JavaClass c) Deprecated.static ClassDescriptorcreateClassDescriptorFromDottedClassName(String dottedClassName) Deprecated.static ClassDescriptorcreateClassDescriptorFromSignature(String signature) Deprecated.final booleanstatic ClassDescriptorfromFieldSignature(String signature) Deprecated.static ClassDescriptorfromResourceName(String resourceName) Deprecated.final StringGet the name of the class in dotted format.Get the name of the package in dotted format.Get the simple name of the classinthashCode()booleanbooleanisArray()static booleanisClassResource(String resourceName) Deprecated.UseDescriptorFactory.isClassResource(String)insteadbooleanstatic voidthrowClassNotFoundException(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:
compareToin 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