|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tapestry5.ioc.services.ClassFabUtils
public final class ClassFabUtils
Handy method useful when creating new classes using ClassFab.
| Constructor Summary | |
|---|---|
ClassFabUtils()
|
|
| Method Summary | ||
|---|---|---|
static String |
castReference(String reference,
String desiredType)
Takes a reference and casts it to the desired type. |
|
static
|
createObjectCreatorProxy(ClassFab classFab,
Class<T> serviceInterface,
ObjectCreator creator,
String description)
Creates a proxy for a given service interface around an ObjectCreator that can
provide (on demand) an object (implementing the service interface) to delegate to. |
|
static String |
generateClassName(Class interfaceClass)
Returns a class name derived from the provided interfaceClass. |
|
static String |
generateClassName(String baseName)
Generates a unique class name, which will be in the default package. |
|
static Class |
getPrimitiveType(Class wrapperType)
Given a wrapper type, determines the corresponding primitive type. |
|
static Class |
getPrimitiveType(String primitiveTypeName)
|
|
static String |
getTypeCode(Class type)
Converts a Class to a JVM type code (the way class information is expressed in a class file). |
|
static Class |
getWrapperType(Class type)
Returns the wrapper type for an input type; for most types, this is the type. |
|
static boolean |
isPrimitiveType(String typeName)
Given a type name, determines if that is the name of a primitive type. |
|
static boolean |
isToString(Method method)
Returns true if the method is the standard toString() method. |
|
static String |
toJavaClassName(Class inputClass)
Javassist needs the class name to be as it appears in source code, even for arrays. |
|
static String |
toJVMBinaryName(String type)
Translates types from standard Java format to Java VM format. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClassFabUtils()
| Method Detail |
|---|
public static String generateClassName(String baseName)
public static String generateClassName(Class interfaceClass)
generateClassName(String).
public static String toJavaClassName(Class inputClass)
public static boolean isToString(Method method)
public static Class getPrimitiveType(String primitiveTypeName)
public static String toJVMBinaryName(String type)
public static Class getPrimitiveType(Class wrapperType)
public static Class getWrapperType(Class type)
type - type to check
public static String castReference(String reference,
String desiredType)
reference - to be castdesiredType - desired object or primitive type
public static boolean isPrimitiveType(String typeName)
public static String getTypeCode(Class type)
public static <T> T createObjectCreatorProxy(ClassFab classFab,
Class<T> serviceInterface,
ObjectCreator creator,
String description)
ObjectCreator that can
provide (on demand) an object (implementing the service interface) to delegate to. The ObjectCreator will be
invoked on every method invocation (if it is caching, that should be internal to its implementation).
T - classFab - used to create the new classserviceInterface - the interface the proxy will implementcreator - the createor which will provide an instance of the interfacedescription - description to be returned from the proxy's toString() method
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||