public class SuppressElement extends java.lang.Object implements Filter
AuditEvent
objects based on the criteria of file, check, module id, line, and
column. It rejects an AuditEvent if the following match:
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
checkPattern
The pattern for check class names.
|
private java.util.regex.Pattern |
checkRegexp
The regexp to match check names against.
|
private CsvFilter |
columnFilter
Column number filter.
|
private java.lang.String |
columnsCsv
CSV for column number filter.
|
private java.lang.String |
filePattern
The pattern for file names.
|
private java.util.regex.Pattern |
fileRegexp
The regexp to match file names against.
|
private CsvFilter |
lineFilter
Line number filter.
|
private java.lang.String |
linesCsv
CSV for line number filter.
|
private java.lang.String |
moduleId
Module id filter.
|
Constructor and Description |
---|
SuppressElement(java.lang.String files)
Constructs a
SuppressElement for a
file name pattern. |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(AuditEvent event)
Determines whether or not a filtered AuditEvent is accepted.
|
boolean |
equals(java.lang.Object other) |
int |
hashCode() |
private boolean |
isFileNameAndModuleNotMatching(AuditEvent event)
Is matching by file name and Check name.
|
private boolean |
isLineAndColumnMatch(AuditEvent event)
Whether line and column match.
|
void |
setChecks(java.lang.String checks)
Set the check class pattern.
|
void |
setColumns(java.lang.String columns)
Sets the CSV values and ranges for column number filtering.
|
void |
setLines(java.lang.String lines)
Sets the CSV values and ranges for line number filtering.
|
void |
setModuleId(java.lang.String moduleId)
Set the module id for filtering.
|
private final java.util.regex.Pattern fileRegexp
private final java.lang.String filePattern
private java.util.regex.Pattern checkRegexp
private java.lang.String checkPattern
private java.lang.String moduleId
private CsvFilter lineFilter
private java.lang.String linesCsv
private CsvFilter columnFilter
private java.lang.String columnsCsv
public SuppressElement(java.lang.String files)
SuppressElement
for a
file name pattern. Must either call setColumns(String)
or
setModuleId(String)
before using this object.files
- regular expression for names of filtered files.public void setChecks(java.lang.String checks)
checks
- regular expression for filtered check classes.public void setModuleId(java.lang.String moduleId)
moduleId
- the idpublic void setLines(java.lang.String lines)
lines
- CSV values and ranges for line number filtering.public void setColumns(java.lang.String columns)
columns
- CSV values and ranges for column number filtering.public boolean accept(AuditEvent event)
Filter
private boolean isFileNameAndModuleNotMatching(AuditEvent event)
event
- eventprivate boolean isLineAndColumnMatch(AuditEvent event)
event
- event to process.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object