|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hivemind.service.ClassFabUtils
public class ClassFabUtils
Static class containing utility methods.
Method Summary | |
---|---|
static void |
addNoOpMethod(ClassFab cf,
MethodSignature m)
Adds a method that does nothing. |
static void |
addToStringMethod(ClassFab classFab,
java.lang.String toStringResult)
Adds a toString() method to a class that returns a fixed, pre-computed value. |
static java.lang.String |
generateClassName(java.lang.Class interfaceClass)
Returns a class name derived from the provided interfaceClass. |
static java.lang.String |
generateClassName(java.lang.String baseName)
Generates a unique class name, which will be in the default package. |
static java.lang.Class |
getInstanceClass(ClassFab classFab,
java.lang.Object instance,
java.lang.Class interfaceClass)
Returns the class of an instance. |
static java.lang.Class |
getInstanceClass(java.lang.Object instance,
java.lang.Class interfaceClass)
Deprecated. Please use version which takes a ClassFab object. |
static java.lang.String |
getJavaClassName(java.lang.Class inputClass)
Javassist needs the class name to be as it appears in source code, even for arrays. |
static boolean |
isToString(java.lang.reflect.Method method)
Returns true if the method is the standard toString() method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String generateClassName(java.lang.String baseName)
public static java.lang.String generateClassName(java.lang.Class interfaceClass)
generateClassName(String)
.
public static java.lang.String getJavaClassName(java.lang.Class inputClass)
public static boolean isToString(java.lang.reflect.Method method)
public static void addToStringMethod(ClassFab classFab, java.lang.String toStringResult)
toString()
method to a class that returns a fixed, pre-computed value.
classFab
- ClassFab used to construct the new class.toStringResult
- fixed result to be returned by the method.public static java.lang.Class getInstanceClass(ClassFab classFab, java.lang.Object instance, java.lang.Class interfaceClass)
interfaceClass
is returned instead.
instance
- the object instance to obtain a class frominterfaceClass
- the interface class to return if the instance is not compatiblepublic static java.lang.Class getInstanceClass(java.lang.Object instance, java.lang.Class interfaceClass)
instance
- the object instance to obtain a class frominterfaceClass
- the interface class to return if the instance is a JDK proxy.public static void addNoOpMethod(ClassFab cf, MethodSignature m)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |