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
Abstract superclass for Rules that use a Groovy AST Visitor and can optionally run in enhanced mode.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Holds the name of the system property which allows to control theenhancedMode
property.private boolean
Controls weather to run in enhanced mode.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 -
Method Summary
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 Details
-
ENHANCED_MODE_SYSTEM_PROPERTY
Holds the name of the system property which allows to control theenhancedMode
property.- See Also:
-
enhancedMode
private boolean enhancedModeControls weather to run in enhanced mode. Note that running in enhanced mode will use a later compilation phase which will require any classes referenced from the analysed code to be available on the classpath. This property is set tofalse
by default and can be also controlled usingorg.codenarc.enhancedMode
system property.
-
-
Constructor Details
-
AbstractEnhanceableAstVisitorRule
public AbstractEnhanceableAstVisitorRule()
-
-
Method Details
-
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)
-