Package org.datanucleus.enhancer.methods
Class InitClass
- java.lang.Object
-
- org.datanucleus.enhancer.ClassMethod
-
- org.datanucleus.enhancer.methods.InitClass
-
public class InitClass extends ClassMethod
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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addInitialiseInstructions(MethodVisitor mv)
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 Detail
-
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 Detail
-
getInstance
public static InitClass getInstance(ClassEnhancer enhancer)
-
execute
public void execute()
Method to add the contents of the class method.- Specified by:
execute
in classClassMethod
-
addInitialiseInstructions
public void addInitialiseInstructions(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
-
-