Login | Register
My pages Projects Community openCollabNet

The Tigris site will receive a major upgrade the evening of Monday, December 1, beginning at 8:30 pm PST. Downtime is projected to be about ten hours. Further details in the announcement


jmt.codebase
Class ClassNameFactory

java.lang.Object
  |
  +--jmt.codebase.ClassNameFactory

public final class ClassNameFactory
extends java.lang.Object

A static factory providing methods to create ClassName instances.

Implementation note: Uses a cache to speed up the create(String) method.

Author:
Martin Kersten
See Also:
ClassName

Constructor Summary
ClassNameFactory()
           
 
Method Summary
static ClassName create(ClassName name, int dimension)
          Returns a new ClassName instance based on name and the given dimension.
static ClassName create(java.lang.String name)
          Returns a ClassName instance describing the class name.
static ClassName create(java.lang.String name, java.lang.String[] packages, int dimension)
          Returns a ClassName instance with the given name, the given packages and the given dimension.
static ClassName create(java.lang.String name, java.lang.String packageName, int dimension)
          Returns a ClassName instance according to the given name, the given package name and the dimension.
static ClassName getJavaLangObject()
          Returns the ClassName describing the class java.lang.Object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassNameFactory

public ClassNameFactory()
Method Detail

create

public static ClassName create(java.lang.String name)
Returns a ClassName instance describing the class name.

The name is expected to have the format [[[package.classname.

Parameters:
name - The name of the class in the [[[package.classname format
Returns:
A ClassName instance describing the name

create

public static ClassName create(java.lang.String name,
                               java.lang.String[] packages,
                               int dimension)
Returns a ClassName instance with the given name, the given packages and the given dimension.

Parameters:
name - The name of the class
packages - The package names the class may belong to
dimension - The dimension of the class
Returns:
A ClassName instance according to the given parameters

create

public static ClassName create(java.lang.String name,
                               java.lang.String packageName,
                               int dimension)
Returns a ClassName instance according to the given name, the given package name and the dimension.

Parameters:
name - The name of the class
dimension - The dimension of the class
Returns:
A ClassName instance according to the method parameters.

create

public static ClassName create(ClassName name,
                               int dimension)
Returns a new ClassName instance based on name and the given dimension.

Parameters:
name - The name the new class name is based on
dimension - The dimension of the new class name
Returns:
A new ClassName instance based on name and the dimension

getJavaLangObject

public static ClassName getJavaLangObject()
Returns the ClassName describing the class java.lang.Object.

Returns:
jmt.codebase.ClassName