class IllegalClassReferenceRule extends AbstractAstVisitorRule
Checks for reference to any of the named classes.
TheclassNames
property specifies the comma-separated list of (fully-qualified) class names to check for.
The class name(s) may optionally include wildcard characters ('*' or '?'). Note that the '*' wildcard
matches any sequence of zero or more characters in the class/package name, e.g. 'a.*.MyClass' matches
'a.b.MyClass' as well as 'a.b.c.d.MyClass'. If classNames
is null or empty, do nothing.
Known limitation: Does not catch references as Anonymous Inner class: def x = new org.bad.Handler() { .. } 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 |
---|---|
java.lang.String |
classNames |
java.lang.String |
name |
int |
priority |
Constructor and description |
---|
IllegalClassReferenceRule
() |
Type Params | Return Type | Name and description |
---|---|---|
|
AstVisitor |
getAstVisitor() |
|
boolean |
isReady() |
Groovy Documentation