⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 excessiveimportsrule.java

📁 检查Java程序漏洞
💻 JAVA
字号:
/** * BSD-style license; for more info see http://pmd.sourceforge.net/license.html*/package net.sourceforge.pmd.rules;import net.sourceforge.pmd.ast.ASTCompilationUnit;import net.sourceforge.pmd.ast.ASTImportDeclaration;import net.sourceforge.pmd.rules.design.ExcessiveNodeCountRule;/** * ExcessiveImportsRule attempts to count all unique imports a class * contains. This rule will count a "import com.something.*;" as a single * import. This is a unqiue situation and I'd like to create an audit type * rule that captures those. * * @since Feb 21, 2003 * @author aglover * */public class ExcessiveImportsRule extends ExcessiveNodeCountRule {    /**     * Hook constructor to pass in parent type     */    public ExcessiveImportsRule() {        super(ASTCompilationUnit.class);    }    /**     * Hook method to count imports. This is a user defined value.     * @return Object     * @param ASTImportDeclaration node     * @param Object data     */    public Object visit(ASTImportDeclaration node, Object data) {        return new Integer(1);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -