Class SuppressionFilter
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.api.AutomaticBean
-
- com.puppycrawl.tools.checkstyle.filters.SuppressionFilter
-
- All Implemented Interfaces:
Configurable
,Contextualizable
,ExternalResourceHolder
,Filter
public class SuppressionFilter extends AutomaticBean implements Filter, ExternalResourceHolder
This filter accepts AuditEvents according to file, check, line, and column, as specified in a suppression file.
- Author:
- Rick Giles, liscju
-
-
Constructor Summary
Constructors Constructor Description SuppressionFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(AuditEvent event)
Determines whether or not a filtered AuditEvent is accepted.boolean
equals(Object obj)
protected void
finishLocalSetup()
Provides a hook to finish the part of this component's setup that was not handled by the bean introspection.Set<String>
getExternalResourceLocations()
Returns a set of external configuration resource locations which are used by the module.int
hashCode()
void
setFile(String fileName)
Sets name of the supression file.void
setOptional(boolean optional)
Sets whether config file existence is optional.-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
configure, contextualize, getConfiguration, setupChild
-
-
-
-
Constructor Detail
-
SuppressionFilter
public SuppressionFilter()
-
-
Method Detail
-
setFile
public void setFile(String fileName)
Sets name of the supression file.- Parameters:
fileName
- name of the suppressions file.
-
setOptional
public void setOptional(boolean optional)
Sets whether config file existence is optional.- Parameters:
optional
- tells if config file existence is optional.
-
accept
public boolean accept(AuditEvent event)
Description copied from interface:Filter
Determines whether or not a filtered AuditEvent is accepted.
-
finishLocalSetup
protected void finishLocalSetup() throws CheckstyleException
Description copied from class:AutomaticBean
Provides a hook to finish the part of this component's setup that was not handled by the bean introspection.The default implementation does nothing.
- Overrides:
finishLocalSetup
in classAutomaticBean
- Throws:
CheckstyleException
- if there is a configuration error.
-
getExternalResourceLocations
public Set<String> getExternalResourceLocations()
Description copied from interface:ExternalResourceHolder
Returns a set of external configuration resource locations which are used by the module. ATTENTION! If 'getExternalResourceLocations()' return null, there will beNullPointerException
inChecker
. Such behaviour will signal that your module (check or filter) is designed incorrectly. It make sense to return an empty set from 'getExternalResourceLocations()' only for composite modules likeTreeWalker
.- Specified by:
getExternalResourceLocations
in interfaceExternalResourceHolder
- Returns:
- a set of external configuration resource locations which are used by the module.
-
-