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 ClassFactory
java.lang.Object
|
+--jmt.codebase.ClassFactory
- public final class ClassFactory
- extends java.lang.Object
A static factory providing methods to create Class,
Interface, Field, Method,
ClassElements and MethodParameters
instances.
- Author:
- Martin Kersten
|
Method Summary |
static Class |
createClass(ClassName name,
Modifier modifier,
ClassReference superclass,
ClassReference[] interfaces)
Returns a new Class instance according to the given characteristics. |
static ClassElements |
createClassElements()
Returns a new instance of the ClassElements type.
|
static Field |
createField(ClassReference owner,
java.lang.String name,
Modifier modifier,
ClassReference type)
Returns a new Field instance representing a field
of a class or an interface. |
static Interface |
createInterface(ClassName name,
Modifier modifier,
ClassReference[] superclasses)
Returns a new Interface instance according to the given characteristics. |
static Method |
createMethod(ClassReference owner,
java.lang.String name,
Modifier modifier,
ClassReference type,
MethodParameters parameters)
Returns a new Method instance representing a method
of a class or an interface. |
static MethodParameters |
createParameters(ClassReference[] parameters)
Returns a MethodParameter instance describing the given
parameter signature (types).
|
static MethodParameters |
getEmptyParameters()
Returns a MethodParameters instance with no parameters. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ClassFactory
public ClassFactory()
createClass
public static Class createClass(ClassName name,
Modifier modifier,
ClassReference superclass,
ClassReference[] interfaces)
- Returns a new Class instance according to the given characteristics.
- Parameters:
name - The name of the classmodifier - The modifier of the classsuperclass - The extended superclass of the classinterfaces - The implemented interfaces
- Returns:
- The new Interface instance
createClassElements
public static ClassElements createClassElements()
- Returns a new instance of the ClassElements type.
Implementation note: The class elements instance is of type
MutableClassElements.
- Returns:
- The new ClassElements instance
createField
public static Field createField(ClassReference owner,
java.lang.String name,
Modifier modifier,
ClassReference type)
- Returns a new Field instance representing a field
of a class or an interface.
- Parameters:
owner - The owner of the fieldname - The name of the fieldmodifier - The modifier of the fieldtype - The type of the field
- Returns:
- The created Field instance
createInterface
public static Interface createInterface(ClassName name,
Modifier modifier,
ClassReference[] superclasses)
- Returns a new Interface instance according to the given characteristics.
- Parameters:
name - The name of the classmodifier - The modifier of the classsuperclasses - The extended superclass interfaces.
- Returns:
- The new Interface instance
createMethod
public static Method createMethod(ClassReference owner,
java.lang.String name,
Modifier modifier,
ClassReference type,
MethodParameters parameters)
- Returns a new Method instance representing a method
of a class or an interface.
- Parameters:
owner - The owner of the methodname - The name of the methodmodifier - The modifier of the methodtype - The type of the methodparameters - The parameters of the method
- Returns:
- The created Method instance
createParameters
public static MethodParameters createParameters(ClassReference[] parameters)
- Returns a MethodParameter instance describing the given
parameter signature (types).
Implementation note: The instances of no parameter
and single parameter signatures are implemented
using the flyweight pattern.
- Parameters:
parameters - The types of the parameters.
- Returns:
- The MethodParameter instance describing the given
parameter signature.
getEmptyParameters
public static MethodParameters getEmptyParameters()
- Returns a MethodParameters instance with no parameters.
- Returns:
- The MethodParameters instance with no parameters