FindBugs™ 1.3.9

edu.umd.cs.findbugs.classfile
Class ClassDescriptor

java.lang.Object
  extended by 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.

Author:
David Hovemeyer
See Also:
Serialized Form

Field Summary
static ClassDescriptor[] EMPTY_ARRAY
           
 
Constructor Summary
protected ClassDescriptor(java.lang.String className)
          Constructor.
 
Method Summary
 int compareTo(ClassDescriptor o)
           
static ClassDescriptor createClassDescriptor(org.apache.bcel.classfile.JavaClass c)
          Deprecated. Use DescriptorFactory.createClassDescriptor(JavaClass) instead
static ClassDescriptor createClassDescriptor(java.lang.String className)
          Deprecated. Use DescriptorFactory.createClassDescriptor(String) instead
static ClassDescriptor[] createClassDescriptor(java.lang.String[] classNames)
          Deprecated. Use DescriptorFactory.createClassDescriptor(String[]) instead
static ClassDescriptor createClassDescriptorFromDottedClassName(java.lang.String dottedClassName)
          Deprecated. Use DescriptorFactory.createClassDescriptorFromDottedClassName(String) instead
static ClassDescriptor createClassDescriptorFromSignature(java.lang.String signature)
          Deprecated. Use DescriptorFactory.createClassDescriptorFromSignature(String) instead
 boolean equals(java.lang.Object obj)
           
static ClassDescriptor fromFieldSignature(java.lang.String signature)
          Deprecated. Use DescriptorFactory.createClassDescriptorFromFieldSignature(String) instead
static ClassDescriptor fromResourceName(java.lang.String resourceName)
          Deprecated. Use DescriptorFactory.createClassDescriptorFromResourceName(String) instead
 java.lang.String getClassName()
           
 java.lang.String getDottedClassName()
          Get the name of the class in dotted format.
 java.lang.String getPackageName()
          Get the name of the package in dotted format.
 java.lang.String getSimpleName()
          Get the simple name of the class
 int hashCode()
           
 boolean isAnonymousClass()
           
static boolean isClassResource(java.lang.String resourceName)
          Deprecated. Use DescriptorFactory.isClassResource(String) instead
static void throwClassNotFoundException(ClassDescriptor classDescriptor)
          Throw a ClassNotFoundException to indicate that class named by given ClassDescriptor cannot be found.
 java.lang.String toDottedClassName()
          Get the name of the class in dotted format.
 java.lang.String toResourceName()
          Get the resource name of this class as it would appear in the classpath.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

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:
compareTo in interface java.lang.Comparable<ClassDescriptor>

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

@DottedClassName
public java.lang.String toDottedClassName()
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

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

fromResourceName

@Deprecated
public static ClassDescriptor fromResourceName(java.lang.String resourceName)
Deprecated. Use DescriptorFactory.createClassDescriptorFromResourceName(String) instead

Create a class descriptor from a resource name.

Parameters:
resourceName - the resource name
Returns:
the class descriptor

fromFieldSignature

@Deprecated
@CheckForNull
public static ClassDescriptor fromFieldSignature(java.lang.String signature)
Deprecated. Use DescriptorFactory.createClassDescriptorFromFieldSignature(String) instead

Create a class descriptor from a field signature


isClassResource

@Deprecated
public static boolean isClassResource(java.lang.String resourceName)
Deprecated. Use DescriptorFactory.isClassResource(String) instead

Determine 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
public static ClassDescriptor createClassDescriptorFromSignature(java.lang.String signature)
Deprecated. Use DescriptorFactory.createClassDescriptorFromSignature(String) instead


createClassDescriptor

@Deprecated
public static ClassDescriptor createClassDescriptor(@SlashedClassName
                                                               java.lang.String className)
Deprecated. Use DescriptorFactory.createClassDescriptor(String) instead


createClassDescriptor

@Deprecated
public static ClassDescriptor[] createClassDescriptor(java.lang.String[] classNames)
Deprecated. Use DescriptorFactory.createClassDescriptor(String[]) instead


createClassDescriptorFromDottedClassName

@Deprecated
public static ClassDescriptor createClassDescriptorFromDottedClassName(java.lang.String dottedClassName)
Deprecated. Use DescriptorFactory.createClassDescriptorFromDottedClassName(String) instead


createClassDescriptor

@Deprecated
public static ClassDescriptor createClassDescriptor(org.apache.bcel.classfile.JavaClass c)
Deprecated. Use DescriptorFactory.createClassDescriptor(JavaClass) instead


toString

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

equals

public final boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.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()

FindBugs™ 1.3.9

FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.