|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.enhancer.ClassMethod
org.datanucleus.enhancer.asm.ASMClassMethod
org.datanucleus.enhancer.asm.method.JdoCopyField
public class JdoCopyField
Method to generate the method "jdoCopyField" using ASM.
protected final void jdoCopyField(Answer obj, int index)
{
switch (index)
{
case 0:
question = obj.question;
break;
default:
throw new IllegalArgumentException("out of field index :" + index);
}
}
or with superclass
protected final void jdoCopyField(ComplexAnswer obj, int index)
{
switch (index - jdoInheritedFieldCount)
{
case 0:
param1 = obj.param1;
break;
case 1:
param2 = obj.param2;
break;
default:
super.jdoCopyField(obj, index);
}
}
and also with minor variations if the class has no fields
| Field Summary |
|---|
| Fields inherited from class org.datanucleus.enhancer.asm.ASMClassMethod |
|---|
visitor |
| Fields inherited from class org.datanucleus.enhancer.ClassMethod |
|---|
access, argNames, argTypes, enhancer, exceptions, LOCALISER, methodName, returnType |
| Constructor Summary | |
|---|---|
JdoCopyField(ClassEnhancer enhancer,
String name,
int access,
Object returnType,
Object[] argTypes,
String[] argNames)
Constructor. |
|
| Method Summary | |
|---|---|
void |
execute()
Method to add the contents of the class method. |
static JdoCopyField |
getInstance(ASMClassEnhancer enhancer)
|
| Methods inherited from class org.datanucleus.enhancer.asm.ASMClassMethod |
|---|
getClassEnhancer, getDescriptor, initialise, initialise |
| Methods inherited from class org.datanucleus.enhancer.ClassMethod |
|---|
close, equals, getAccess, getMethodAdditionMessage, getName, hashCode |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JdoCopyField(ClassEnhancer enhancer,
String name,
int access,
Object returnType,
Object[] argTypes,
String[] argNames)
enhancer - ClassEnhancername - Name of methodaccess - Access typereturnType - Return typeargTypes - Argument typesargNames - Argument names| Method Detail |
|---|
public static JdoCopyField getInstance(ASMClassEnhancer enhancer)
public void execute()
execute in class ClassMethod
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||