public static InvokeReplacer with(final String classCanonicalName, final String methodName) { return new InvokeReplacer(classCanonicalName, methodName); }
@Override public void visitTypeInsn(final int opcode, final String type) { if (opcode == NEW) { InvokeInfo invokeInfo = new InvokeInfo(type, INIT, StringPool.EMPTY); for (InvokeAspect aspect : aspects) { InvokeReplacer ir = aspect.pointcut(invokeInfo); if (ir != null && !ir.isNone()) { newInvokeReplacer = ir; // new pointcut found, skip the new instruction and the following dup. // and then go to the invokespecial return; } } } super.visitTypeInsn(opcode, type); }
owner = newInvokeReplacer.getOwner(); name = newInvokeReplacer.getMethodName(); desc = changeReturnType(desc, 'L' + exOwner + ';'); super.visitMethodInsn(INVOKESTATIC, owner, name, desc, isInterface); if (ir == null || ir.isNone()) { owner = ir.getOwner(); name = ir.getMethodName(); if (ir.isPassOwnerName()) { desc = appendArgument(desc, AsmUtil.L_SIGNATURE_JAVA_LANG_STRING); super.visitLdcInsn(exOwner); if (ir.isPassMethodName()) { desc = appendArgument(desc, AsmUtil.L_SIGNATURE_JAVA_LANG_STRING); super.visitLdcInsn(methodInfo.getMethodName()); if (ir.isPassMethodSignature()) { desc = appendArgument(desc, AsmUtil.L_SIGNATURE_JAVA_LANG_STRING); super.visitLdcInsn(methodInfo.getSignature()); if (ir.isPassTargetClass()) { desc = appendArgument(desc, AsmUtil.L_SIGNATURE_JAVA_LANG_CLASS); super.mv.visitLdcInsn(Type.getType('L' + wd.superReference + ';')); if (ir.isPassThis()) { desc = appendArgument(desc, AsmUtil.L_SIGNATURE_JAVA_LANG_OBJECT); super.mv.visitVarInsn(ALOAD, 0);
owner = newInvokeReplacer.getOwner(); name = newInvokeReplacer.getMethodName(); desc = changeReturnType(desc, 'L' + exOwner + ';'); super.visitMethodInsn(INVOKESTATIC, owner, name, desc); owner = ir.getOwner(); name = ir.getMethodName(); if (ir.isPassOwnerName()) { desc = appendArgument(desc, AsmConst.L_SIGNATURE_JAVA_LANG_STRING); super.visitLdcInsn(exOwner); if (ir.isPassMethodName()) { desc = appendArgument(desc, AsmConst.L_SIGNATURE_JAVA_LANG_STRING); super.visitLdcInsn(methodInfo.getMethodName()); if (ir.isPassMethodSignature()) { desc = appendArgument(desc, AsmConst.L_SIGNATURE_JAVA_LANG_STRING); super.visitLdcInsn(methodInfo.getSignature()); if (ir.isPassTargetClass()) { desc = appendArgument(desc, AsmConst.L_SIGNATURE_JAVA_LANG_CLASS); super.mv.visitLdcInsn(Type.getType('L' + wd.superReference + ';')); if (ir.isPassThis()) { desc = appendArgument(desc, AsmConst.L_SIGNATURE_JAVA_LANG_OBJECT); super.mv.visitVarInsn(ALOAD, 0);
owner = newInvokeReplacer.getOwner(); name = newInvokeReplacer.getMethodName(); desc = changeReturnType(desc, 'L' + exOwner + ';'); super.visitMethodInsn(INVOKESTATIC, owner, name, desc, isInterface); if (ir == null || ir.isNone()) { owner = ir.getOwner(); name = ir.getMethodName(); if (ir.isPassOwnerName()) { desc = appendArgument(desc, AsmUtil.L_SIGNATURE_JAVA_LANG_STRING); super.visitLdcInsn(exOwner); if (ir.isPassMethodName()) { desc = appendArgument(desc, AsmUtil.L_SIGNATURE_JAVA_LANG_STRING); super.visitLdcInsn(methodInfo.getMethodName()); if (ir.isPassMethodSignature()) { desc = appendArgument(desc, AsmUtil.L_SIGNATURE_JAVA_LANG_STRING); super.visitLdcInsn(methodInfo.getSignature()); if (ir.isPassTargetClass()) { desc = appendArgument(desc, AsmUtil.L_SIGNATURE_JAVA_LANG_CLASS); super.mv.visitLdcInsn(Type.getType('L' + wd.superReference + ';')); if (ir.isPassThis()) { desc = appendArgument(desc, AsmUtil.L_SIGNATURE_JAVA_LANG_OBJECT); super.mv.visitVarInsn(ALOAD, 0);
public static InvokeReplacer with(final Class target, final String methodName) { return new InvokeReplacer(target, methodName); }
@Override public void visitTypeInsn(final int opcode, final String type) { if (opcode == NEW) { InvokeInfo invokeInfo = new InvokeInfo(type, INIT, StringPool.EMPTY); for (InvokeAspect aspect : aspects) { InvokeReplacer ir = aspect.pointcut(invokeInfo); if (ir != null && !ir.isNone()) { newInvokeReplacer = ir; // new pointcut found, skip the new instruction and the following dup. // and then go to the invokespecial return; } } } super.visitTypeInsn(opcode, type); }
public static InvokeReplacer with(final String classCanonicalName, final String methodName) { return new InvokeReplacer(classCanonicalName, methodName); }
public static InvokeReplacer with(String classCanonicalName, String methodName) { return new InvokeReplacer(classCanonicalName, methodName); }
public static InvokeReplacer with(Class target, String methodName) { return new InvokeReplacer(target, methodName); }
public static InvokeReplacer with(final Class target, final String methodName) { return new InvokeReplacer(target, methodName); }