Class RuleUtil
- java.lang.Object
-
- org.apache.maven.plugins.checkstyle.RuleUtil
-
public final class RuleUtil extends java.lang.ObjectTooling for Checkstyle rules conventions: names, categories.- Since:
- 2.13
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classRuleUtil.ExtensionMatcherAn extension does not start with Checkstyle package.static interfaceRuleUtil.MatcherAudit event source name matcher.private static classRuleUtil.PackageMatcherprivate static classRuleUtil.RuleMatcher
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringCHECKSTYLE_PACKAGE
-
Constructor Summary
Constructors Modifier Constructor Description privateRuleUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetCategory(com.puppycrawl.tools.checkstyle.api.AuditEvent event)Get the rule category from an audit event.static java.lang.StringgetCategory(java.lang.String eventSrcName)Get the rule category from an audit event source name.static java.lang.StringgetName(com.puppycrawl.tools.checkstyle.api.AuditEvent event)Get the rule name from an audit event.static java.lang.StringgetName(java.lang.String eventSrcName)Get the rule name from an audit event source name.static java.util.List<RuleUtil.Matcher>parseMatchers(java.lang.String[] specs)
-
-
-
Field Detail
-
CHECKSTYLE_PACKAGE
private static final java.lang.String CHECKSTYLE_PACKAGE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public static java.lang.String getName(com.puppycrawl.tools.checkstyle.api.AuditEvent event)
Get the rule name from an audit event.- Parameters:
event- the audit event- Returns:
- the rule name, which is the class name without package and removed eventual "Check" suffix
-
getName
public static java.lang.String getName(java.lang.String eventSrcName)
Get the rule name from an audit event source name.- Parameters:
eventSrcName- the audit event source name- Returns:
- the rule name, which is the class name without package and removed eventual "Check" suffix
-
getCategory
public static java.lang.String getCategory(com.puppycrawl.tools.checkstyle.api.AuditEvent event)
Get the rule category from an audit event.- Parameters:
event- the audit event- Returns:
- the rule category, which is the last package name or "misc" or "extension"
-
getCategory
public static java.lang.String getCategory(java.lang.String eventSrcName)
Get the rule category from an audit event source name.- Parameters:
eventSrcName- the audit event source name- Returns:
- the rule category, which is the last package name or "misc" or "extension"
-
parseMatchers
public static java.util.List<RuleUtil.Matcher> parseMatchers(java.lang.String[] specs)
-
-