public class SeverityMatchFilter extends AutomaticBean implements Filter
Filter SeverityMatchFilter
decides audit events according to the
severity level of the event.
SeverityMatchFilter can suppress Checks that have Treewalker or Checker as parent module.
severity
- Specify the severity level of this filter.
Type is com.puppycrawl.tools.checkstyle.api.SeverityLevel
.
Default value is error
.
acceptOnMatch
- Control whether the filter accepts an audit
event if and only if there is a match between the event's severity level and
property severity. If acceptOnMatch is false
, then the filter accepts
an audit event if and only if there is not a match between the event's severity
level and property severity.
Type is boolean
.
Default value is true
.
For example, the following configuration fragment directs the Checker to not
report audit events with severity level info
:
<module name="SeverityMatchFilter"> <property name="severity" value="info"/> <property name="acceptOnMatch" value="false"/> </module>
Parent is com.puppycrawl.tools.checkstyle.Checker
AutomaticBean.OutputStreamOptions
Constructor and Description |
---|
SeverityMatchFilter() |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(AuditEvent event)
Determines whether or not a filtered AuditEvent is accepted.
|
protected void |
finishLocalSetup()
Provides a hook to finish the part of this component's setup that
was not handled by the bean introspection.
|
void |
setAcceptOnMatch(boolean acceptOnMatch)
Setter to control whether the filter accepts an audit event if and only if there
is a match between the event's severity level and property severity.
|
void |
setSeverity(SeverityLevel severity)
Setter to specify the severity level of this filter.
|
configure, contextualize, getConfiguration, setupChild
public SeverityMatchFilter()
public final void setSeverity(SeverityLevel severity)
severity
- The new severity levelSeverityLevel
public final void setAcceptOnMatch(boolean acceptOnMatch)
false
, then the filter accepts an audit event
if and only if there is not a match between the event's severity level and property severity.acceptOnMatch
- if true, accept on matches; if
false, reject on matches.protected void finishLocalSetup()
AutomaticBean
The default implementation does nothing.
finishLocalSetup
in class AutomaticBean
public boolean accept(AuditEvent event)
Filter
Copyright © 2001–2020. All rights reserved.