private static void appendSet(Method method, ClassWriter cw, Class<?> target, String targetType, String propertyType, String classType) { MethodVisitor mv; { mv = cw.visitMethod(ACC_PUBLIC, "set", "(" + AsmUtils.toTargetTypeDeclaration(targetType) + AsmUtils.toTargetTypeDeclaration(propertyType) + ")V", null, new String[] { "java/lang/Exception" }); mv.visitCode(); mv.visitVarInsn(ALOAD, 1); mv.visitVarInsn(ALOAD, 2); AsmUtils.invoke(mv, target, method.getName(), "(" + AsmUtils.toTargetTypeDeclaration(propertyType) + ")" + AsmUtils.toTargetTypeDeclaration(method.getReturnType())); mv.visitInsn(RETURN); mv.visitMaxs(2, 3); mv.visitEnd(); } appendSynthetic(cw, targetType, propertyType, classType); }
private static void appendSet(Method method, ClassWriter cw, Class<?> target, String targetType, String propertyType, String classType) { MethodVisitor mv; { mv = cw.visitMethod(ACC_PUBLIC, "set", "(" + AsmUtils.toTargetTypeDeclaration(targetType) + AsmUtils.toTargetTypeDeclaration(propertyType) + ")V", null, new String[] { "java/lang/Exception" }); mv.visitCode(); mv.visitVarInsn(ALOAD, 1); mv.visitVarInsn(ALOAD, 2); AsmUtils.invoke(mv, target, method.getName(), "(" + AsmUtils.toTargetTypeDeclaration(propertyType) + ")" + AsmUtils.toTargetTypeDeclaration(method.getReturnType())); mv.visitInsn(RETURN); mv.visitMaxs(2, 3); mv.visitEnd(); } appendSynthetic(cw, targetType, propertyType, classType); }
private static void appendSet(Field field, ClassWriter cw, Class<?> target, String targetType, String propertyType, String classType) { MethodVisitor mv; { mv = cw.visitMethod(ACC_PUBLIC, "set", "(" + AsmUtils.toTargetTypeDeclaration(targetType) + AsmUtils.toTargetTypeDeclaration(propertyType) + ")V", null, new String[] { "java/lang/Exception" }); mv.visitCode(); mv.visitVarInsn(ALOAD, 1); mv.visitVarInsn(ALOAD, 2); mv.visitFieldInsn(PUTFIELD, targetType, field.getName(), AsmUtils.toTargetTypeDeclaration(propertyType)); mv.visitInsn(RETURN); mv.visitMaxs(2, 3); mv.visitEnd(); } appendSynthetic(cw, targetType, propertyType, classType); }
private static void appendSet(Field field, ClassWriter cw, Class<?> target, String targetType, String propertyType, String classType) { MethodVisitor mv; { mv = cw.visitMethod(ACC_PUBLIC, "set", "(" + AsmUtils.toTargetTypeDeclaration(targetType) + AsmUtils.toTargetTypeDeclaration(propertyType) + ")V", null, new String[] { "java/lang/Exception" }); mv.visitCode(); mv.visitVarInsn(ALOAD, 1); mv.visitVarInsn(ALOAD, 2); mv.visitFieldInsn(PUTFIELD, targetType, field.getName(), AsmUtils.toTargetTypeDeclaration(propertyType)); mv.visitInsn(RETURN); mv.visitMaxs(2, 3); mv.visitEnd(); } appendSynthetic(cw, targetType, propertyType, classType); }