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.
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
file
Filename of supression file.
|
private FilterSet |
filters
Set of individual suppresses.
|
private boolean |
optional
Tells whether config file existence is optional.
|
Constructor and Description |
---|
SuppressionFilter() |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(AuditEvent event)
Determines whether or not a filtered AuditEvent is accepted.
|
boolean |
equals(java.lang.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.
|
java.util.Set<java.lang.String> |
getExternalResourceLocations()
Returns a set of external configuration resource locations which are used by the module.
|
int |
hashCode() |
void |
setFile(java.lang.String fileName)
Sets name of the supression file.
|
void |
setOptional(boolean optional)
Sets whether config file existence is optional.
|
private static boolean |
suppressionSourceExists(java.lang.String fileName)
Checks if suppression source with given fileName exists.
|
configure, contextualize, getConfiguration, setupChild
private java.lang.String file
private boolean optional
private FilterSet filters
public void setFile(java.lang.String fileName)
fileName
- name of the suppressions file.public void setOptional(boolean optional)
optional
- tells if config file existence is optional.public boolean accept(AuditEvent event)
Filter
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
protected void finishLocalSetup() throws CheckstyleException
AutomaticBean
The default implementation does nothing.
finishLocalSetup
in class AutomaticBean
CheckstyleException
- if there is a configuration error.public java.util.Set<java.lang.String> getExternalResourceLocations()
ExternalResourceHolder
NullPointerException
in Checker
.
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 like TreeWalker
.getExternalResourceLocations
in interface ExternalResourceHolder
private static boolean suppressionSourceExists(java.lang.String fileName)
fileName
- name of the suppressions file.