public abstract class AbstractNamingConventionInspection<T extends PsiNameIdentifierOwner> extends LocalInspectionTool
NamingConvention
extensions which are processed one by one,
the first which returns true from NamingConvention.isApplicable(PsiNameIdentifierOwner)
, wins and provides bean to check the member name.
Provide createRenameFix()
to register rename fix.
Register AbstractNamingConventionMerger
to provide settings migration from multiple inspections to compound oneEMPTY_ARRAY, VALID_ID_PATTERN
myNameProvider
Modifier | Constructor and Description |
---|---|
protected |
AbstractNamingConventionInspection(java.lang.Iterable<NamingConvention<T>> extensions,
java.lang.String defaultConventionShortName) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkName(T member,
java.util.function.Consumer<? super java.lang.String> errorRegister) |
protected void |
checkName(T member,
java.lang.String name,
ProblemsHolder holder) |
protected java.lang.String |
createErrorMessage(java.lang.String name,
java.lang.String shortName) |
javax.swing.JComponent |
createOptionsPanel()
This method is called each time UI is shown.
|
protected abstract LocalQuickFix |
createRenameFix() |
NamingConventionBean |
getNamingConventionBean(java.lang.String shortName) |
java.util.Set<java.lang.String> |
getOldToolNames() |
boolean |
isConventionEnabled(java.lang.String shortName) |
void |
readSettings(Element node)
Read in settings from XML config.
|
protected void |
registerConvention(NamingConvention<T> convention) |
protected void |
registerConventionsListener(ExtensionPointName<NamingConvention<T>> epName) |
void |
setEnabled(boolean value,
java.lang.String conventionShortName) |
protected void |
unregisterConvention(NamingConvention<T> extension) |
void |
writeSettings(Element node)
Store current settings in XML config.
|
buildVisitor, buildVisitor, checkFile, getAlternativeID, getID, getProblemElement, getSuppressId, inspectionFinished, inspectionFinished, inspectionStarted, isValidID, processFile, runForWholeFile
cleanup, getBatchSuppressActions, getBlackList, getDefaultLevel, getDescriptionContextClass, getDescriptionFileName, getDisplayName, getGeneralGroupName, getGroupDisplayName, getGroupKey, getGroupPath, getMainToolId, getSerializationFilter, getShortName, getShortName, getStaticDescription, getSuppressors, initialize, isEnabledByDefault, isInitialized, isSuppressedFor, loadDescription, showDefaultConfigurationOptions
protected AbstractNamingConventionInspection(java.lang.Iterable<NamingConvention<T>> extensions, java.lang.String defaultConventionShortName)
protected void registerConvention(NamingConvention<T> convention)
protected void unregisterConvention(NamingConvention<T> extension)
protected void registerConventionsListener(ExtensionPointName<NamingConvention<T>> epName)
protected abstract LocalQuickFix createRenameFix()
public NamingConventionBean getNamingConventionBean(java.lang.String shortName)
public java.util.Set<java.lang.String> getOldToolNames()
protected java.lang.String createErrorMessage(java.lang.String name, java.lang.String shortName)
public void readSettings(Element node)
InspectionProfileEntry
int TOOL_OPTION
)
and bean-style getters/setters (like int getToolOption(), void setToolOption(int)
) to store your options.readSettings
in class InspectionProfileEntry
node
- to read settings from.public void writeSettings(Element node)
InspectionProfileEntry
int TOOL_OPTION
)
and bean-style getters/setters (like int getToolOption(), void setToolOption(int)
) to store your options.writeSettings
in class InspectionProfileEntry
node
- to store settings to.public boolean isConventionEnabled(java.lang.String shortName)
protected void checkName(T member, java.lang.String name, ProblemsHolder holder)
protected void checkName(T member, java.util.function.Consumer<? super java.lang.String> errorRegister)
public javax.swing.JComponent createOptionsPanel()
InspectionProfileEntry
createOptionsPanel
in class InspectionProfileEntry
null
if no UI options required.public void setEnabled(boolean value, java.lang.String conventionShortName)