getMethod(void.class, methodName, Object.class, field.getType()),
null, new Type[0], classWriter);
if (isPrivate) {
// set the value using the generic void get(Object, Object) method with boxing the value.
mg.loadThis();
mg.loadArgs();
mg.valueOf(Type.getType(field.getType()));
mg.invokeVirtual(Type.getObjectType(className), getMethod(void.class, "set", Object.class, Object.class));
} else {
// Simply access the field.
mg.loadArg(0);