org.datanucleus.enhancer.asm.method
Class JdoReplaceField
java.lang.Object
org.datanucleus.enhancer.ClassMethod
org.datanucleus.enhancer.asm.ASMClassMethod
org.datanucleus.enhancer.asm.method.JdoReplaceField
public class JdoReplaceField
- extends ASMClassMethod
Method to generate the method "jdoReplaceField" using ASM.
public void jdoReplaceField(int fieldIndex)
{
if (jdoStateManager == null)
throw new IllegalStateException("state manager is null");
switch (fieldIndex)
{
case 0:
{
MyClass ref = this;
ref.param1 = (MyOtherClass) ref.jdoStateManager.replacingObjectField(this, fieldIndex);
break;
}
default:
throw new IllegalArgumentException("out of field index :" + fieldIndex);
}
}
or with superclass
public void jdoReplaceField(int fieldIndex)
{
if (jdoStateManager == null)
throw new IllegalStateException("state manager is null");
switch (fieldIndex - jdoInheritedFieldCount)
{
case 0:
{
MyClass ref = this;
ref.param1 = (MyOtherClass)ref.jdoStateManager.replacingStringField(this, fieldIndex);
break;
}
default:
super.jdoReplaceField(fieldIndex);
}
}
JdoReplaceField
public JdoReplaceField(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 JdoReplaceField getInstance(ClassEnhancer 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.