final String methodName = (bind ? "" : "un") + "bind" + referenceName.substring(0, 1).toUpperCase() + referenceName.substring(1);
final MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PROTECTED, methodName, "(" + type.toString() + ")V", null, null);
mv.visitVarInsn(Opcodes.ALOAD, 0);
if ( bind ) {
mv.visitVarInsn(type.getOpcode(Opcodes.ILOAD), 1);
mv.visitFieldInsn(Opcodes.PUTFIELD, className.replace('.', '/'), fieldName, type.toString());
} else {
mv.visitFieldInsn(Opcodes.GETFIELD, className.replace('.', '/'), fieldName, type.toString());
mv.visitVarInsn(Opcodes.ALOAD, 1);
final Label jmpLabel = new Label();
mv.visitJumpInsn(Opcodes.IF_ACMPNE, jmpLabel);