if (cmrField.isSynthetic()) {
return;
}
final String methodName = getterName(cmrField.getName());
final MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, methodName, "()" + cmrField.getProxyDescriptor(), null, null);
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD, implClassName, cmrField.getName() + "Cmr", cmrField.getAccessorDescriptor());
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD, implClassName, cmrField.getName(), cmrField.getDescriptor());
// return this.${cmrField.name}Cmr.get(this.${cmdField.name});
// this takes the value stored in the CMR field (which might be a single value or
// a Set or Collection), and hands it to the appropriate accessor.
mv.visitMethodInsn(INVOKEVIRTUAL, cmrField.getAccessorInternalName(), "get", cmrField.getCmrStyle().getGetterDescriptor(), false);
// if the style is a single value, then we're going to need to cast this
// to the target class before returning.
if (cmrField.getCmrStyle() == CmrStyle.SINGLE) {
mv.visitTypeInsn(CHECKCAST, cmrField.getProxyType().getInternalName());
}
mv.visitInsn(ARETURN);
mv.visitMaxs(0, 0);
mv.visitEnd();
}