org.datanucleus.enhancer.asm.method
Class JdoCopyFields
java.lang.Object
org.datanucleus.enhancer.ClassMethod
org.datanucleus.enhancer.asm.ASMClassMethod
org.datanucleus.enhancer.asm.method.JdoCopyFields
public class JdoCopyFields
- extends ASMClassMethod
Method to generate the method "jdoCopyFields" using ASM.
public void jdoCopyFields(Object obj, int[] fieldNumbers)
{
if (jdoStateManager == null)
throw new IllegalStateException("state manager is null");
if (fieldNumbers == null)
throw new IllegalStateException("fieldNumbers is null");
if (!(obj instanceof Answer))
throw new IllegalArgumentException
("object is not an object of type mydomain.MyClass");
MyClass other = (MyClass) obj;
if (jdoStateManager != other.jdoStateManager)
throw new IllegalArgumentException("state managers do not match");
int i = fieldNumbers.length - 1;
if (i >= 0) {
do
jdoCopyField(other, fieldNumbers[i]);
while (--i >= 0);
}
}
JdoCopyFields
public JdoCopyFields(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 JdoCopyFields getInstance(ASMClassEnhancer enhancer)
execute
public void execute()
- Method to add the contents of the class method.
- Specified by:
execute in class ClassMethod
Copyright © 2012. All Rights Reserved.