简体   繁体   English

需要java pmd规则在myeclipse中进行注释

[英]need java pmd rule for comments in myeclipse

i am trying to write a java pmd rule to check source code comments. 我试图编写一个Java pmd规则来检查源代码注释。 The rule should be able to identify all the method and variable declarations. 该规则应能够识别所有方法和变量声明。 If any method/variable declares without comment, the rule should give a warning as method/variable created without comments. 如果任何方法/变量声明无注释,则该规则应发出警告,因为创建的方法/变量无注释。 any idea will be appreciated.......! 任何想法将不胜感激.......!

Unfortunately it's not possible with PMD because XPath expressions are working on the Abstract Syntax Tree (AST) and AST does not contain comments. 不幸的是,这对于PMD是不可能的,因为XPath表达式在抽象语法树(AST)上起作用,并且AST不包含注释。 Maybe Checkstyle would be a better candidate for this task. 也许Checkstyle将是此任务的更好选择。

(You can check this with a PMD plugin in Eclipse. Right click on a class which contains some comments, PMD / Generate Abstract Syntax Tree, then search in the generated ast file for your comments. There is no sign of any of them.) (您可以在Eclipse中使用PMD插件进行检查。右键单击包含一些注释的类,PMD /生成抽象语法树,然后在生成的ast文件中搜索您的注释。没有任何注释。)

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

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