org.datanucleus.enhancer.asm.method
Class InitClass
java.lang.Object
org.datanucleus.enhancer.ClassMethod
org.datanucleus.enhancer.asm.ASMClassMethod
org.datanucleus.enhancer.asm.method.InitClass
public class InitClass
- extends ASMClassMethod
Method to generate a static initialisation block for the class using ASM.
static
{
jdoFieldNames = __jdoFieldNamesInit();
jdoFieldTypes = __jdoFieldTypesInit();
jdoFieldFlags = __jdoFieldFlagsInit();
jdoInheritedFieldCount = __jdoGetInheritedFieldCount();
jdoPersistenceCapableSuperclass = __jdoPersistenceCapableSuperclassInit();
JDOImplHelper.registerClass(___jdo$loadClass("mydomain.MyClass"),
jdoFieldNames, jdoFieldTypes, jdoFieldFlags,
jdoPersistenceCapableSuperclass, new MyClass());
}
InitClass
public InitClass(ClassEnhancer enhancer,
String name,
int access,
Object returnType,
Object[] argTypes,
String[] argNames)
- Constructor.
- Parameters:
enhancer - ClassEnhancername - Name of methodaccess - Access typereturnType - Return typeargTypes - Argument typesargNames - Argument names
getInstance
public static InitClass getInstance(ASMClassEnhancer enhancer)
execute
public void execute()
- Method to add the contents of the class method.
- Specified by:
execute in class ClassMethod
addInitialiseInstructions
public void addInitialiseInstructions(org.objectweb.asm.MethodVisitor mv)
- Convenience method to add the initialise instructions to the supplied MethodVisitor.
Available as a separate method so that the initialise instructions can be added to an existing
static class initialise block (where the class already has one).
- Parameters:
mv - MethodVisitor to use
Copyright © 2012. All Rights Reserved.