edu.umd.cs.findbugs.classfile

Class ClassDescriptor

public class ClassDescriptor extends Object implements Comparable<ClassDescriptor>, Serializable

Descriptor identifying a class.

Author: David Hovemeyer

Constructor Summary
ClassDescriptor(String className)
Constructor.
Method Summary
intcompareTo(ClassDescriptor o)
static ClassDescriptorfromResourceName(String resourceName)
Create a class descriptor from a resource name.
StringgetClassName()
static booleanisClassResource(String resourceName)
Determine whether or not the given resource name refers to a class.
StringtoDottedClassName()
Get the name of the class in dotted format.
StringtoResourceName()
Get the resource name of this class as it would appear in the classpath.

Constructor Detail

ClassDescriptor

public ClassDescriptor(String className)
Constructor.

Parameters: className class name in VM format, e.g. "java/lang/String"

Method Detail

compareTo

public int compareTo(ClassDescriptor o)

fromResourceName

public static ClassDescriptor fromResourceName(String resourceName)
Create a class descriptor from a resource name.

Parameters: resourceName the resource name

Returns: the class descriptor

getClassName

public String getClassName()

Returns: Returns the class name in VM format, e.g. "java/lang/String"

isClassResource

public static boolean isClassResource(String resourceName)
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

toDottedClassName

public String toDottedClassName()
Get the name of the class in dotted format.

Returns: the name of the class in dotted format

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

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