Class SeverityMatchFilter
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
-
- com.puppycrawl.tools.checkstyle.filters.SeverityMatchFilter
-
- All Implemented Interfaces:
Configurable
,Contextualizable
,Filter
public class SeverityMatchFilter extends AbstractAutomaticBean implements Filter
FilterSeverityMatchFilter
decides audit events according to the severity level of the event.SeverityMatchFilter can suppress Checks that have Treewalker or Checker as parent module.
-
Property
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 isfalse
, 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 isboolean
. Default value istrue
. -
Property
severity
- Specify the severity level of this filter. Type iscom.puppycrawl.tools.checkstyle.api.SeverityLevel
. Default value iserror
.
Parent is
com.puppycrawl.tools.checkstyle.Checker
- Since:
- 3.2
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
AbstractAutomaticBean.OutputStreamOptions
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
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.private SeverityLevel
severity
Specify the severity level of this filter.
-
Constructor Summary
Constructors Constructor Description SeverityMatchFilter()
-
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.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.-
Methods inherited from class com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
configure, contextualize, getConfiguration, setupChild
-
-
-
-
Field Detail
-
severity
private SeverityLevel severity
Specify the severity level of this filter.
-
acceptOnMatch
private boolean 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 isfalse
, 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.
-
-
Constructor Detail
-
SeverityMatchFilter
public SeverityMatchFilter()
-
-
Method Detail
-
setSeverity
public final void setSeverity(SeverityLevel severity)
Setter to specify the severity level of this filter.- Parameters:
severity
- The new severity level- Since:
- 3.2
- See Also:
SeverityLevel
-
setAcceptOnMatch
public final 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. If acceptOnMatch isfalse
, 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.- Parameters:
acceptOnMatch
- if true, accept on matches; if false, reject on matches.- Since:
- 3.2
-
finishLocalSetup
protected void finishLocalSetup()
Description copied from class:AbstractAutomaticBean
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.
- Specified by:
finishLocalSetup
in classAbstractAutomaticBean
-
accept
public boolean accept(AuditEvent event)
Description copied from interface:Filter
Determines whether or not a filtered AuditEvent is accepted.
-
-