Package org.datanucleus.enhancer.methods
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 org.datanucleus.enhancer.ClassMethod
access, argNames, argTypes, enhancer, exceptions, methodName, returnType, visitor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Convenience method to add the initialise instructions to the supplied MethodVisitor.void
execute()
Method to add the contents of the class method.static InitClass
getInstance
(ClassEnhancer enhancer) Methods inherited from class org.datanucleus.enhancer.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:
execute
in 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
-