class UnusedPrivateFieldRule extends AbstractSharedAstVisitorRule
Rule that checks for private fields that are not referenced within the same class.
Ignore fields annotated withignoreFieldNames property optionally specifies one or more
(comma-separated) field names that should be ignored (i.e., that should not cause a
rule violation). The name(s) may optionally include wildcard characters ('*' or '?').
The ignoreClassesAnnotatedWithNames property optionally specifies one or more
(comma-separated) annotation names; any classes annotated with those should be ignored (i.e., should not cause a
rule violation). The name(s) may optionally include wildcard characters ('*' or '?').| Fields inherited from class | Fields |
|---|---|
class AbstractAstVisitorRule |
CLOSURE_TEXT, DEFAULT_CONST_NAME, DEFAULT_FIELD_NAME, DEFAULT_TEST_CLASS_NAMES, DEFAULT_TEST_FILES, DEFAULT_VAR_NAME |
| Type | Name and description |
|---|---|
boolean |
allowConstructorOnlyUsages |
java.lang.String |
ignoreClassesAnnotatedWithNames |
java.lang.String |
ignoreFieldNames |
java.lang.String |
name |
int |
priority |
| Constructor and description |
|---|
UnusedPrivateFieldRule
() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected AstVisitor |
getAstVisitor(SourceCode sourceCode) |
|
protected java.util.List<Violation> |
getViolations(AstVisitor visitor, SourceCode sourceCode) |
|
protected boolean |
shouldApplyThisRuleTo(ClassNode classNode) |
Groovy Documentation