Package org.codenarc.rule
Class AbstractEnhanceableAstVisitorRule
- java.lang.Object
-
- org.codenarc.rule.AbstractRule
-
- org.codenarc.rule.AbstractAstVisitorRule
-
- org.codenarc.rule.AbstractEnhanceableAstVisitorRule
-
- All Implemented Interfaces:
Rule
- Direct Known Subclasses:
CloseWithoutCloseableRule
,CompareToWithoutComparableRule
public abstract class AbstractEnhanceableAstVisitorRule extends AbstractAstVisitorRule
Abstract superclass for Rules that use a Groovy AST Visitor and can optionally run in enhanced mode.- Author:
- Marcin Erdmann
-
-
Field Summary
Fields Modifier and Type Field Description static String
ENHANCED_MODE_SYSTEM_PROPERTY
Holds the name of the system property which allows to control theenhancedMode
property.-
Fields inherited from class org.codenarc.rule.AbstractAstVisitorRule
CLOSURE_TEXT, DEFAULT_CONST_NAME, DEFAULT_FIELD_NAME, DEFAULT_TEST_CLASS_NAMES, DEFAULT_TEST_FILES, DEFAULT_VAR_NAME
-
-
Constructor Summary
Constructors Constructor Description AbstractEnhanceableAstVisitorRule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCompilerPhase()
boolean
isEnhancedMode()
void
setEnhancedMode(boolean enhancedMode)
-
Methods inherited from class org.codenarc.rule.AbstractAstVisitorRule
applyTo, getApplyToClassNames, getAstVisitor, getAstVisitorClass, getDoNotApplyToClassNames, setApplyToClassNames, setDoNotApplyToClassNames, shouldApplyThisRuleTo
-
Methods inherited from class org.codenarc.rule.AbstractRule
applyTo, createViolation, createViolation, createViolationForImport, createViolationForImport, getApplyToFileNames, getApplyToFilesMatching, getDescription, getDoNotApplyToFileNames, getDoNotApplyToFilesMatching, getName, getPriority, getViolationMessage, isEnabled, isReady, setApplyToFileNames, setApplyToFilesMatching, setDescription, setDoNotApplyToFileNames, setDoNotApplyToFilesMatching, setEnabled, setName, setPriority, setViolationMessage, toString, validate
-
-
-
-
Field Detail
-
ENHANCED_MODE_SYSTEM_PROPERTY
public static final String ENHANCED_MODE_SYSTEM_PROPERTY
Holds the name of the system property which allows to control theenhancedMode
property.- See Also:
- Constant Field Values
-
-
Method Detail
-
isEnhancedMode
public boolean isEnhancedMode()
-
setEnhancedMode
public void setEnhancedMode(boolean enhancedMode)
-
getCompilerPhase
public int getCompilerPhase()
- Specified by:
getCompilerPhase
in interfaceRule
- Overrides:
getCompilerPhase
in classAbstractRule
- Returns:
- the required compiler phase (as in
Phases
) of the AST of theSourceCode
handed to the rule viaAbstractRule.applyTo(SourceCode sourceCode)
-
-