|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jpox.enhancer.GeneratorBase
Enhancer base class.
Field Summary | |
protected java.util.List |
addFieldList
append field list |
protected long |
addSerialVersionUID
serialVersionUID value |
EnhancerClassMetaData |
classConfig
class config of enhancing class |
java.lang.String |
className
class name of enhancing class |
org.apache.bcel.generic.ObjectType |
classType
class type of enhancing class |
protected org.jpox.ClassLoaderResolver |
clr
|
org.apache.bcel.generic.ConstantPoolGen |
constantPoolGen
constatnt pool of enhancing class |
org.jpox.metadata.FileMetaData |
jdoConfig
config of enhancing class |
protected static org.jpox.util.Localiser |
LOCALISER
Message resource |
protected java.util.List |
methodBuilderList
append method list |
org.apache.bcel.generic.ClassGen |
newClass
enhancing class |
org.apache.bcel.classfile.JavaClass |
oldClass
Original class |
org.jpox.metadata.PackageMetaData |
packageConfig
package config of enhancing class |
protected boolean |
update
flag for enhanceing ok |
Constructor Summary | |
GeneratorBase(EnhancerClassMetaData classConfig)
Constructor. |
Method Summary | |
java.lang.String |
check()
Method to check the class for obvious errors |
protected 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 |
abstract void |
enhanceClassAfter()
call after check enhanceClass() method. |
abstract void |
enhanceClassBefore()
call after check method. |
void |
enhanceFields()
Method to enhance the fields |
abstract void |
enhanceFieldsAfter()
call after check enhanceFields() method. |
abstract void |
enhanceFieldsBefore()
call after check enhanceClassAfter() method. |
protected void |
enhanceGetter(EnhancerFieldMetaData fieldConfig)
|
void |
enhanceMethod()
Method to enhance the methods of the class. |
abstract void |
enhanceMethodAfter()
call after check enhanceMethod() method. |
abstract void |
enhanceMethodBefore()
call after check enhanceFieldsAfter() method. |
protected void |
enhanceOriginalMethod(org.apache.bcel.classfile.Method m)
|
protected void |
enhanceOriginalMethods()
|
protected void |
enhanceSetter(EnhancerFieldMetaData fieldConfig)
|
void |
enhanceStaticInitializer()
call after check enhanceStaticInitializerBefore() method. |
abstract void |
enhanceStaticInitializerAfter()
call after check enhanceStaticInitializer() method. |
abstract void |
enhanceStaticInitializerBefore()
call after check enhanceMethodAfter() method. |
protected void |
field_addField(org.apache.bcel.generic.FieldGen fieldGen)
|
byte[] |
getBytes()
Access the class in byte array format |
org.jpox.ClassLoaderResolver |
getClassLoaderResolver()
|
static java.lang.String[] |
getFullClassNames(org.jpox.metadata.FileMetaData config)
|
protected abstract GeneratorBase |
getGenerator()
|
protected void |
init_addFieldsList()
append basic fields. |
protected void |
init_addMethodCallbackList()
append basic method. |
void |
init()
Initialisation. |
static org.jpox.metadata.FileMetaData[] |
readJDOConfig(org.jpox.PMFContext context,
java.lang.String[] fileList)
Method to read in and initialise the supplied JDO MetaData files. |
protected abstract 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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static org.jpox.util.Localiser LOCALISER
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 org.jpox.metadata.FileMetaData jdoConfig
public final org.jpox.metadata.PackageMetaData packageConfig
public final EnhancerClassMetaData classConfig
public final java.lang.String className
public final org.apache.bcel.generic.ObjectType classType
protected java.util.List addFieldList
protected java.util.List methodBuilderList
protected boolean update
protected long addSerialVersionUID
protected final org.jpox.ClassLoaderResolver clr
Constructor Detail |
public GeneratorBase(EnhancerClassMetaData classConfig)
classConfig
- base config file.Method Detail |
protected abstract GeneratorBase getGenerator()
public void init()
init
in interface Generator
protected void init_addMethodCallbackList()
protected void init_addFieldsList()
public java.lang.String check()
check
in interface Generator
protected java.lang.String checkHasDefaultConstructor()
protected boolean checkEnhanced()
public void enhance()
enhance
in interface Generator
public void enhanceClass()
enhanceClass
in interface Generator
protected void class_addInterface(java.lang.String interfaceName)
interfaceName
- Name of the interface to add.public abstract void enhanceClassAfter()
Generator
enhanceClassAfter
in interface Generator
public abstract void enhanceClassBefore()
Generator
enhanceClassBefore
in interface Generator
public void enhanceFields()
enhanceFields
in interface Generator
protected void field_addField(org.apache.bcel.generic.FieldGen fieldGen)
public abstract void enhanceFieldsAfter()
Generator
enhanceFieldsAfter
in interface Generator
public abstract void enhanceFieldsBefore()
Generator
enhanceFieldsBefore
in interface Generator
public void enhanceMethod()
enhanceMethod
in interface Generator
public abstract void enhanceMethodAfter()
Generator
enhanceMethodAfter
in interface Generator
public abstract void enhanceMethodBefore()
Generator
enhanceMethodBefore
in interface Generator
public void enhanceStaticInitializer()
Generator
enhanceStaticInitializer
in interface Generator
protected abstract void staticInitializerAppend(org.apache.bcel.generic.InstructionFactory factory, org.apache.bcel.generic.InstructionList il)
public abstract void enhanceStaticInitializerAfter()
Generator
enhanceStaticInitializerAfter
in interface Generator
public abstract void enhanceStaticInitializerBefore()
Generator
enhanceStaticInitializerBefore
in interface Generator
protected void enhanceOriginalMethod(org.apache.bcel.classfile.Method m)
protected void enhanceOriginalMethods()
protected void enhanceSetter(EnhancerFieldMetaData fieldConfig)
protected void enhanceGetter(EnhancerFieldMetaData fieldConfig)
public static java.lang.String[] getFullClassNames(org.jpox.metadata.FileMetaData config)
public static org.jpox.metadata.FileMetaData[] readJDOConfig(org.jpox.PMFContext context, java.lang.String[] fileList) throws java.lang.Exception
context
- the PMF contextfileList
- List of files.
java.lang.Exception
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.IOException
public byte[] getBytes()
public void verify() throws java.lang.Exception
java.lang.Exception
public org.jpox.ClassLoaderResolver getClassLoaderResolver()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |