Package org.codenarc.rule.imports
Class AbstractImportRule
- java.lang.Object
-
- org.codenarc.rule.AbstractRule
-
- org.codenarc.rule.imports.AbstractImportRule
-
- All Implemented Interfaces:
groovy.lang.GroovyObject
,Rule
- Direct Known Subclasses:
DuplicateImportRule
,MisorderedStaticImportsRule
,NoWildcardImportsRule
public abstract class AbstractImportRule extends AbstractRule implements groovy.lang.GroovyObject
-
-
Field Summary
Fields Modifier and Type Field Description static String
NON_STATIC_IMPORT_PATTERN
static String
STATIC_IMPORT_PATTERN
-
Constructor Summary
Constructors Constructor Description AbstractImportRule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
eachImportLine(SourceCode sourceCode, groovy.lang.Closure closure)
protected int
findLineNumberOfFirstClassDeclaration(SourceCode sourceCode)
groovy.lang.MetaClass
getMetaClass()
Object
getProperty(String property)
Object
invokeMethod(String method, Object arguments)
void
setMetaClass(groovy.lang.MetaClass mc)
void
setProperty(String property, Object value)
-
Methods inherited from class org.codenarc.rule.AbstractRule
applyTo, applyTo, createViolation, createViolation, createViolationForImport, createViolationForImport, getApplyToFileNames, getApplyToFilesMatching, getCompilerPhase, getDescription, getDoNotApplyToFileNames, getDoNotApplyToFilesMatching, getName, getPriority, getViolationMessage, isEnabled, isReady, setApplyToFileNames, setApplyToFilesMatching, setDescription, setDoNotApplyToFileNames, setDoNotApplyToFilesMatching, setEnabled, setName, setPriority, setViolationMessage, toString, validate
-
-
-
-
Field Detail
-
NON_STATIC_IMPORT_PATTERN
public static final String NON_STATIC_IMPORT_PATTERN
- See Also:
- Constant Field Values
-
STATIC_IMPORT_PATTERN
public static final String STATIC_IMPORT_PATTERN
- See Also:
- Constant Field Values
-
-
Method Detail
-
getMetaClass
public groovy.lang.MetaClass getMetaClass()
- Specified by:
getMetaClass
in interfacegroovy.lang.GroovyObject
-
setMetaClass
public void setMetaClass(groovy.lang.MetaClass mc)
- Specified by:
setMetaClass
in interfacegroovy.lang.GroovyObject
-
invokeMethod
public Object invokeMethod(String method, Object arguments)
- Specified by:
invokeMethod
in interfacegroovy.lang.GroovyObject
-
getProperty
public Object getProperty(String property)
- Specified by:
getProperty
in interfacegroovy.lang.GroovyObject
-
setProperty
public void setProperty(String property, Object value)
- Specified by:
setProperty
in interfacegroovy.lang.GroovyObject
-
findLineNumberOfFirstClassDeclaration
protected int findLineNumberOfFirstClassDeclaration(SourceCode sourceCode)
-
eachImportLine
protected void eachImportLine(SourceCode sourceCode, groovy.lang.Closure closure)
-
-