站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss RULES 4.0.0.11754MR2 API 英文版文档

ShadowProxyFactory (Drools 4.0.0.11754MR2 API) - JBoss RULES 4.0.0.11754MR2 API 英文版文档


org.drools.base
Class ShadowProxyFactory

java.lang.Object
  extended by org.drools.base.ShadowProxyFactory

public class ShadowProxyFactory
extends Object

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

FIELD_SET_FLAG

public static final String FIELD_SET_FLAG
See Also:
Constant Field Values

DELEGATE_FIELD_NAME

public static final String DELEGATE_FIELD_NAME
See Also:
Constant Field Values

HASHCACHE_FIELD_NAME

public static final String HASHCACHE_FIELD_NAME
See Also:
Constant Field Values
Constructor Detail

ShadowProxyFactory

public ShadowProxyFactory()
Method Detail

getProxy

public static Class getProxy(Class clazz)

getProxyBytes

public static byte[] getProxyBytes(Class clazz)

getInternalProxyClassNameForClass

public static String getInternalProxyClassNameForClass(Class clazz)
Parameters:
clazz -
Returns:

getProxyClassNameForClass

public static String getProxyClassNameForClass(Class clazz)

dump

protected static byte[] dump(Class clazz,
                             String className)
                      throws Exception
Throws:
Exception

buildClassHeader

protected static void buildClassHeader(Class clazz,
                                       String className,
                                       ClassWriter cw)
Builds the shadow proxy class header

Parameters:
clazz - The class to build shadow proxy for
className - The shadow proxy class name
cw -

buildField

protected static void buildField(String name,
                                 String type,
                                 ClassWriter cw)
Creates the field defined by the given FieldDefinition

Parameters:
cw -
fieldDef -

buildGetMethod

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

Parameters:
fieldName -
fieldFlag -
method -
cw -

buildSimpleGetMethod

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

Parameters:
fieldName -
fieldFlag -
method -
cw -

buildUpdateProxyMethod

protected static void buildUpdateProxyMethod(Map fieldTypes,
                                             String className,
                                             ClassWriter cw)

buildDelegateMethod

protected static void buildDelegateMethod(Method method,
                                          Class clazz,
                                          String className,
                                          ClassWriter cw)

buildEquals

protected static void buildEquals(ClassWriter cw,
                                  String className,
                                  Class clazz,
                                  Map fieldTypes)

buildHashCode

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; }

Parameters:
cw -
className -
clazz -
fieldTypes -


Copyright © 2001-2007 JBoss Inc.. All Rights Reserved.