|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jpox.enhancer.AbstractClassEnhancer
org.jpox.enhancer.bcel.BCELClassEnhancer
public class BCELClassEnhancer
Class enhancer using Apache BCEL (http://jakarta.apache.org/bcel).
| Field Summary | |
|---|---|
protected java.util.List |
addFieldList
append field list |
protected long |
addSerialVersionUID
serialVersionUID value |
BCELClassMetaData |
classConfig
class config of enhancing class (BCEL version of "cmd"). |
org.apache.bcel.generic.ObjectType |
classType
class type of enhancing class |
org.apache.bcel.generic.ConstantPoolGen |
constantPoolGen
constant pool of enhancing class |
protected java.util.List |
methodBuilderList
append method list |
org.apache.bcel.generic.ClassGen |
newClass
enhancing class |
org.apache.bcel.classfile.JavaClass |
oldClass
Original class |
static org.apache.bcel.generic.ObjectType |
OT_BitSet
Object type of java.util.BitSet |
static org.apache.bcel.generic.ObjectType |
OT_ByteIdentity
|
static org.apache.bcel.generic.ObjectType |
OT_CharIdentity
|
static org.apache.bcel.generic.ObjectType |
OT_CLASS
Object type of java.lang.Class |
static org.apache.bcel.generic.ObjectType |
OT_Detachable
Object type of javax.jdo.spi.Detachable |
static org.apache.bcel.generic.Type |
OT_Flag
Field type of jdoFlag |
static org.apache.bcel.generic.ObjectType |
OT_IntIdentity
|
static org.apache.bcel.generic.ObjectType |
OT_JDOImplHelper
Object type of javax.jdo.spi.JDOImplHelper |
static org.apache.bcel.generic.ObjectType |
OT_LongIdentity
Object type of SingleFieldIdentity classes |
static org.apache.bcel.generic.Type |
OT_ObjectArray
Type of Object[] |
static org.apache.bcel.generic.ObjectType |
OT_ObjectIdentity
|
static org.apache.bcel.generic.ObjectType |
OT_ObjectIdFieldConsumer
Object type of javax.jdo.spi.PersistenceCapable.ObjectIdFieldConsumer |
static org.apache.bcel.generic.ObjectType |
OT_ObjectIdFieldSupplier
Object type of javax.jdo.spi.PersistenceCapable.ObjectIdFieldSupplier |
static org.apache.bcel.generic.ObjectType |
OT_PersistenceCapable
Object type of javax.jdo.spi.PersistenceCapable |
static org.apache.bcel.generic.ObjectType |
OT_PersistenceManager
Object type of javax.spi.PersistenceManager |
static org.apache.bcel.generic.ObjectType |
OT_ShortIdentity
|
static org.apache.bcel.generic.ObjectType |
OT_StateManager
Object type of javax.jdo.spi.StateManager |
static org.apache.bcel.generic.ObjectType |
OT_StringIdentity
|
| Fields inherited from class org.jpox.enhancer.AbstractClassEnhancer |
|---|
className, clr, cmd, LOCALISER, update |
| Constructor Summary | |
|---|---|
BCELClassEnhancer(org.jpox.metadata.ClassMetaData cmd,
org.jpox.ClassLoaderResolver clr)
Constructor. |
|
| Method Summary | |
|---|---|
java.lang.String |
check()
Method to check the class for obvious errors |
boolean |
checkEnhanced()
Check original class is already enhanced. |
protected java.lang.String |
checkHasDefaultConstructor()
Check original class has default(no arg) constructor. |
protected void |
class_addInterface(java.lang.String interfaceName)
Method to add the "implements {interface}" to the class description. |
protected void |
dumpClass(java.io.OutputStream out)
|
void |
enhance()
Method to enhance the classes. |
void |
enhanceClass()
Method to enhance the class as a whole, providing the required interfaces and adding any setters/getters for its fields |
void |
enhanceClassAfter()
|
void |
enhanceClassBefore()
|
void |
enhanceFields()
Method to enhance the fields |
void |
enhanceFieldsAfter()
|
void |
enhanceFieldsBefore()
|
protected void |
enhanceGetter(BCELFieldMetaData fieldConfig)
|
void |
enhanceMethod()
Method to enhance the methods of the class. |
void |
enhanceMethodAfter()
|
void |
enhanceMethodBefore()
|
protected void |
enhanceOriginalMethod(org.apache.bcel.classfile.Method m)
|
protected void |
enhanceOriginalMethods()
|
protected void |
enhanceSetter(BCELFieldMetaData fieldConfig)
|
void |
enhanceStaticInitializer()
|
void |
enhanceStaticInitializerAfter()
|
void |
enhanceStaticInitializerBefore()
|
protected void |
field_addField(org.apache.bcel.generic.FieldGen fieldGen)
|
byte[] |
getBytes()
Access the class in byte array format |
protected void |
init_addFieldsList()
append basic fields. |
protected void |
init_addMethodCallbackList()
append basic method. |
void |
init()
Initialisation. |
protected void |
staticInitializerAppend(org.apache.bcel.generic.InstructionFactory factory,
org.apache.bcel.generic.InstructionList il)
|
void |
store(java.lang.String dir)
Enhance the class writing to the specified location. |
void |
update()
Enhance the class, overwriting the existing class location. |
void |
verify()
Method to verify the enhancement state. |
| Methods inherited from class org.jpox.enhancer.AbstractClassEnhancer |
|---|
getClassLoaderResolver, isPersistenceCapable, requiresDetachable |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final org.apache.bcel.classfile.JavaClass oldClass
public final org.apache.bcel.generic.ClassGen newClass
public final org.apache.bcel.generic.ConstantPoolGen constantPoolGen
public final BCELClassMetaData classConfig
public final org.apache.bcel.generic.ObjectType classType
protected java.util.List addFieldList
protected java.util.List methodBuilderList
protected long addSerialVersionUID
public static final org.apache.bcel.generic.Type OT_Flag
public static final org.apache.bcel.generic.Type OT_ObjectArray
public static final org.apache.bcel.generic.ObjectType OT_LongIdentity
public static final org.apache.bcel.generic.ObjectType OT_StringIdentity
public static final org.apache.bcel.generic.ObjectType OT_ShortIdentity
public static final org.apache.bcel.generic.ObjectType OT_IntIdentity
public static final org.apache.bcel.generic.ObjectType OT_CharIdentity
public static final org.apache.bcel.generic.ObjectType OT_ByteIdentity
public static final org.apache.bcel.generic.ObjectType OT_ObjectIdentity
public static final org.apache.bcel.generic.ObjectType OT_PersistenceManager
public static final org.apache.bcel.generic.ObjectType OT_ObjectIdFieldConsumer
public static final org.apache.bcel.generic.ObjectType OT_ObjectIdFieldSupplier
public static final org.apache.bcel.generic.ObjectType OT_BitSet
public static final org.apache.bcel.generic.ObjectType OT_StateManager
public static final org.apache.bcel.generic.ObjectType OT_PersistenceCapable
public static final org.apache.bcel.generic.ObjectType OT_Detachable
public static final org.apache.bcel.generic.ObjectType OT_JDOImplHelper
public static final org.apache.bcel.generic.ObjectType OT_CLASS
| Constructor Detail |
|---|
public BCELClassEnhancer(org.jpox.metadata.ClassMetaData cmd,
org.jpox.ClassLoaderResolver clr)
cmd - MetaData for the class to be enhancedclr - ClassLoader resolver| Method Detail |
|---|
public void init()
protected void init_addMethodCallbackList()
protected void init_addFieldsList()
public java.lang.String check()
protected java.lang.String checkHasDefaultConstructor()
public boolean checkEnhanced()
public void enhance()
public void enhanceClass()
protected void class_addInterface(java.lang.String interfaceName)
interfaceName - Name of the interface to add.public void enhanceClassAfter()
public void enhanceClassBefore()
public void enhanceFields()
protected void field_addField(org.apache.bcel.generic.FieldGen fieldGen)
public void enhanceFieldsAfter()
public void enhanceFieldsBefore()
public void enhanceMethod()
public void enhanceMethodAfter()
public void enhanceMethodBefore()
public void enhanceStaticInitializer()
protected void staticInitializerAppend(org.apache.bcel.generic.InstructionFactory factory,
org.apache.bcel.generic.InstructionList il)
public void enhanceStaticInitializerAfter()
public void enhanceStaticInitializerBefore()
protected void enhanceOriginalMethod(org.apache.bcel.classfile.Method m)
protected void enhanceOriginalMethods()
protected void enhanceSetter(BCELFieldMetaData fieldConfig)
protected void enhanceGetter(BCELFieldMetaData fieldConfig)
public void update()
throws java.io.IOException
java.io.IOException - If an I/O error has occurs in the write.
public void store(java.lang.String dir)
throws java.io.IOException
dir - base dir
java.io.IOException - If an I/O error has occurred.
protected void dumpClass(java.io.OutputStream out)
throws java.io.IOException
java.io.IOExceptionpublic byte[] getBytes()
public void verify()
throws java.lang.Exception
java.lang.Exception - Thrown if an error occurs while verifying
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||