Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想拦截(@AroundInvoke)一个方法调用...用 ctx.getParameters() 获取原始方法参数(通过引用传递)并用其他方法替换它们..但我希望原始参数也被修改(!) ,而不仅仅是使用新参数调用方法。
我可能会尝试对调用方法的类进行子类化,然后在调用 super.AroundInvoke(...) 之前修改参数,例如
public class AroundInvokerOverrider extends ClassWithAroundInvokeMethod { @override public void AroundInvoke(int a, char c, ...) { a += 1; c = 'A'; super.AroundInvoke(a,c); } }