简体   繁体   English

如何在 IntelliJ IDEA 12 中查看方面受影响的 Java 类?

[英]How to view aspect affected Java classes in IntelliJ IDEA 12?

Is there some way to see the aspect affected (advised) Java methods in IntelliJ IDEA?有没有办法在 IntelliJ IDEA 中查看受影响(建议)Java 方法的方面?

Like XRef in Eclipse?像 Eclipse 中的外部参照

外部参照

Edited:编辑:

@Xiujun_Ma showed the feature exists, but I don't know what is not working. @Xiujun_Ma 显示该功能存在,但我不知道什么不起作用。 I'm using the libs and the facets on the project.我在项目中使用库和方面。

Libs:库:

库

Facets:方面:

刻面

In your aspect class you will see like this:在您的方面类中,您将看到如下所示:在此处输入图片说明

click the ball after line number (navigate to advised methods),单击行号后的球(导航到建议的方法),

then, you will see aspect affected methods.然后,您将看到方面受影响的方法。

Yes, it is shown as you can see from @XiujunMa answer.是的,正如您从@XiujunMa 的回答中看到的那样。 It also works in 11.1.3.它也适用于 11.1.3。 Used to navigate to the transaction affected methods in Spring.用于导航到 Spring 中受事务影响的方法。

To be able to use the AspectJ support in IntelliJ IDEA, you have to make sure that the following plugins are enabled:为了能够在 IntelliJ IDEA 中使用 AspectJ 支持,您必须确保启用以下插件:

 Spring-AOP and @AspectJ Support. AspectJ Support.

In addition to that, you should also create a library for aspectjrt.jar.除此之外,您还应该为 aspectjrt.jar 创建一个库。

You probably need to use <aop:config> in the spring configuration to define <aop:pointcut .您可能需要在 spring 配置中使用<aop:config>来定义<aop:pointcut Then use <aop:advisor to map that pointcut and advice reference.然后使用<aop:advisor来映射切入点和建议引用。 You could also put the <aop:aspect there.你也可以把<aop:aspect放在那里。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM