Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/339.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用字节伙伴的私有方法拦截_Java_Byte Buddy - Fatal编程技术网

Java 使用字节伙伴的私有方法拦截

Java 使用字节伙伴的私有方法拦截,java,byte-buddy,Java,Byte Buddy,如何使用byte buddy拦截私有方法?我可以使用通知截取所有公共方法,但当我提交用于截取的私有方法签名时,它没有被截取?我的错误是,有显式的调用元素匹配器只匹配公共,我的错误是我忽略了它,我现在可以截取公共和私有方法。您可以分享一些关于如何使用建议的代码吗?AgentBuilder AgentBuilder=new AgentBuilder.Default()。with(AgentBuilder.RedefinitionStrategy.REDEFINITION)。with(AgentBui

如何使用byte buddy拦截私有方法?我可以使用通知截取所有公共方法,但当我提交用于截取的私有方法签名时,它没有被截取?

我的错误是,有显式的调用元素匹配器只匹配公共,我的错误是我忽略了它,我现在可以截取公共和私有方法。

您可以分享一些关于如何使用建议的代码吗?AgentBuilder AgentBuilder=new AgentBuilder.Default()。with(AgentBuilder.RedefinitionStrategy.REDEFINITION)。with(AgentBuilder.TypeStrategy.Default.REDEFINITION);agentBuilder=agentBuilder.type(ElementMatchers.hasSuperType(命名为(instrumentedClassName))).transform(新建agentBuilder.Transformer.ForAdvice().include(cl.currentClassLoader())/.advice(matchAnyMethodIn(instrumentedMethods))中的MatchAnyMethod,myAdvice.class.getName());嗨,拉斐尔,这是我使用建议的方式,类似于