org.datanucleus.enhancer.asm.method
Class JdoProvideField
java.lang.Object
org.datanucleus.enhancer.ClassMethod
org.datanucleus.enhancer.asm.ASMClassMethod
org.datanucleus.enhancer.asm.method.JdoProvideField
public class JdoProvideField
- extends ASMClassMethod
Method to generate the method "jdoProvideField" using ASM.
public void jdoProvideField(int fieldIndex)
{
if (jdoStateManager == null)
throw new IllegalStateException("state manager is null");
switch (fieldIndex)
{
case 0:
jdoStateManager.providedObjectField(this, fieldIndex, question);
break;
default:
throw new IllegalArgumentException("out of field index :" + fieldIndex);
}
}
and with a superclass
public void jdoProvideField(int fieldIndex)
{
if (jdoStateManager == null)
throw new IllegalStateException("state manager is null");
switch (fieldIndex - jdoInheritedFieldCount)
{
case 0:
jdoStateManager.providedStringField(this, fieldIndex, extraInfo);
break;
default:
super.jdoProvideField(fieldIndex);
}
}
with further minor changes when the class has no fields.
JdoProvideField
public JdoProvideField(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 JdoProvideField 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.