Class SuppressWarningsFilter
- All Implemented Interfaces:
Configurable
,Contextualizable
,Filter
SuppressWarningsFilter
uses annotation
@SuppressWarnings
to suppress audit events.
Rationale: Same as for SuppressionCommentFilter
. In the contrary to it here,
comments are not used comments but the builtin syntax of @SuppressWarnings
.
This can be perceived as a more elegant solution than using comments.
Also, this approach maybe supported by various IDE.
Usage: This filter only works in conjunction with a
SuppressWarningsHolder,
since that check finds the annotations in the Java files and makes them available for the filter.
Because of that, a configuration that includes this filter must also include
SuppressWarningsHolder
as a child module of the TreeWalker
.
Name of check in annotation is case-insensitive and should be written with
any dotted prefix or "Check" suffix removed.
SuppressWarningsFilter can suppress Checks that have Treewalker or Checker as parent module.
Parent is com.puppycrawl.tools.checkstyle.Checker
- Since:
- 5.7
-
Nested Class Summary
Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
AbstractAutomaticBean.OutputStreamOptions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
accept
(AuditEvent event) Determines whether or not a filtered AuditEvent is accepted.protected void
Provides a hook to finish the part of this component's setup that was not handled by the bean introspection.Methods inherited from class com.puppycrawl.tools.checkstyle.AbstractAutomaticBean
configure, contextualize, getConfiguration, setupChild
-
Constructor Details
-
SuppressWarningsFilter
public SuppressWarningsFilter()
-
-
Method Details
-
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
Description copied from interface:Filter
Determines whether or not a filtered AuditEvent is accepted.
-