Class InitClass
java.lang.Object
org.datanucleus.enhancer.ClassMethod
org.datanucleus.enhancer.methods.InitClass
Method to generate a static initialisation block for the class using ASM.
static
{
dnFieldNames = __dnFieldNamesInit();
dnInheritedFieldCount = __dnGetInheritedFieldCount();
EnhancementHelper.registerClass(___dn$loadClass("mydomain.MyClass"), new MyClass());
}
-
Field Summary
Fields inherited from class ClassMethod
access, argNames, argTypes, enhancer, exceptions, methodName, returnType, visitor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidConvenience method to add the initialise instructions to the supplied MethodVisitor.voidexecute()Method to add the contents of the class method.static InitClassgetInstance(ClassEnhancer enhancer) Methods inherited from class ClassMethod
close, equals, getAccess, getClassEnhancer, getDescriptor, getMethodAdditionMessage, getName, getNamer, hashCode, initialise, initialise
-
Constructor Details
-
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
-
-
Method Details
-
getInstance
-
execute
public void execute()Method to add the contents of the class method.- Specified by:
executein classClassMethod
-
addInitialiseInstructions
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
-