|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.drools.base.ShadowProxyFactory
public class ShadowProxyFactory
A factory for ShadowProxy classes
Field Summary | |
---|---|
static String |
DELEGATE_FIELD_NAME
|
static String |
FIELD_SET_FLAG
|
static String |
HASHCACHE_FIELD_NAME
|
Constructor Summary | |
---|---|
ShadowProxyFactory()
|
Method Summary | |
---|---|
protected static void |
buildClassHeader(Class clazz,
String className,
ClassWriter cw)
Builds the shadow proxy class header |
protected static void |
buildDelegateMethod(Method method,
Class clazz,
String className,
ClassWriter cw)
|
protected static void |
buildEquals(ClassWriter cw,
String className,
Class clazz,
Map fieldTypes)
|
protected static void |
buildField(String name,
String type,
ClassWriter cw)
Creates the field defined by the given FieldDefinition |
protected static void |
buildGetMethod(String fieldName,
Class fieldType,
String fieldFlag,
Method method,
String className,
Class clazz,
ClassWriter cw)
Creates the proxy reader method for the given method |
protected static void |
buildHashCode(ClassWriter cw,
String className,
Class clazz,
Map fieldTypes)
Sample of generated code for all primitive + object types public int hashCode() { if( ___hashCache != 0 ) { return __hashCache; } final int PRIME = 31; int result = 1; result = PRIME * result + (booleanAttr ? 1231 : 1237); result = PRIME * result + charAttr; long temp = Double.doubleToLongBits( doubleAttr ); result = PRIME * result + (int) (temp ^ (temp >>> 32)); result = PRIME * result + Float.floatToIntBits( floatAttr ); result = PRIME * result + intAttr; result = PRIME * result + ((listAttr == null) ? 0 : listAttr.hashCode()); result = PRIME * result + (int) (longAttr ^ (longAttr >>> 32)); result = PRIME * result + shortAttr; return result; } |
protected static void |
buildSimpleGetMethod(String fieldName,
Class fieldType,
Method method,
String className,
Class clazz,
ClassWriter cw)
Creates the proxy reader method for the given method |
protected static void |
buildUpdateProxyMethod(Map fieldTypes,
String className,
ClassWriter cw)
|
protected static byte[] |
dump(Class clazz,
String className)
|
static String |
getInternalProxyClassNameForClass(Class clazz)
|
static Class |
getProxy(Class clazz)
|
static byte[] |
getProxyBytes(Class clazz)
|
static String |
getProxyClassNameForClass(Class clazz)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String FIELD_SET_FLAG
public static final String DELEGATE_FIELD_NAME
public static final String HASHCACHE_FIELD_NAME
Constructor Detail |
---|
public ShadowProxyFactory()
Method Detail |
---|
public static Class getProxy(Class clazz)
public static byte[] getProxyBytes(Class clazz)
public static String getInternalProxyClassNameForClass(Class clazz)
clazz
-
public static String getProxyClassNameForClass(Class clazz)
protected static byte[] dump(Class clazz, String className) throws Exception
Exception
protected static void buildClassHeader(Class clazz, String className, ClassWriter cw)
clazz
- The class to build shadow proxy forclassName
- The shadow proxy class namecw
- protected static void buildField(String name, String type, ClassWriter cw)
cw
- fieldDef
- protected static void buildGetMethod(String fieldName, Class fieldType, String fieldFlag, Method method, String className, Class clazz, ClassWriter cw)
fieldName
- fieldFlag
- method
- cw
- protected static void buildSimpleGetMethod(String fieldName, Class fieldType, Method method, String className, Class clazz, ClassWriter cw)
fieldName
- fieldFlag
- method
- cw
- protected static void buildUpdateProxyMethod(Map fieldTypes, String className, ClassWriter cw)
protected static void buildDelegateMethod(Method method, Class clazz, String className, ClassWriter cw)
protected static void buildEquals(ClassWriter cw, String className, Class clazz, Map fieldTypes)
protected static void buildHashCode(ClassWriter cw, String className, Class clazz, Map fieldTypes)
cw
- className
- clazz
- fieldTypes
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |