|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.puppycrawl.tools.checkstyle.api.AutomaticBean
com.puppycrawl.tools.checkstyle.filters.SuppressWithNearbyCommentFilter
public class SuppressWithNearbyCommentFilter
A filter that uses nearby comments to suppress audit events.
This check is philosophically similar to SuppressionCommentFilter
.
Unlike SuppressionCommentFilter
, this filter does not require
pairs of comments. This check may be used to suppress warnings in the
current line:
offendingLine(for, whatever, reason); // SUPPRESS ParameterNumberCheckor it may be configured to span multiple lines, either forward:
// PERMIT MultipleVariableDeclarations NEXT 3 LINES double x1 = 1.0, y1 = 0.0, z1 = 0.0; double x2 = 0.0, y2 = 1.0, z2 = 0.0; double x3 = 0.0, y3 = 0.0, z3 = 1.0;or reverse:
try { thirdPartyLibrary.method(); } catch (RuntimeException e) { // ALLOW ILLEGAL CATCH BECAUSE third party API wraps everything // in RuntimeExceptions. ... }
See SuppressionCommentFilter
for usage notes.
Nested Class Summary | |
---|---|
class |
SuppressWithNearbyCommentFilter.Tag
A Tag holds a suppression comment and its location. |
Constructor Summary | |
---|---|
SuppressWithNearbyCommentFilter()
Constructs a SuppressionCommentFilter. |
Method Summary | |
---|---|
boolean |
accept(AuditEvent aEvent)
Determines whether or not a filtered AuditEvent is accepted. |
FileContents |
getFileContents()
|
void |
setCheckC(boolean aCheckC)
Set whether to look in C comments. |
void |
setCheckCPP(boolean aCheckCPP)
Set whether to look in C++ comments. |
void |
setCheckFormat(String aFormat)
Set the format for a check. |
void |
setCommentFormat(String aFormat)
Set the format for a comment that turns off reporting. |
void |
setFileContents(FileContents aFileContents)
Set the FileContents for this filter. |
void |
setInfluenceFormat(String aFormat)
Set the format for the influence of this check. |
void |
setMessageFormat(String aFormat)
Set the format for a message. |
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean |
---|
configure, contextualize, finishLocalSetup, getConfiguration, setupChild |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SuppressWithNearbyCommentFilter()
Method Detail |
---|
public void setCommentFormat(String aFormat) throws org.apache.commons.beanutils.ConversionException
aFormat
- a String
value.
org.apache.commons.beanutils.ConversionException
- unable to parse aFormat.public FileContents getFileContents()
public void setFileContents(FileContents aFileContents)
aFileContents
- the FileContents for this filter.public void setCheckFormat(String aFormat) throws org.apache.commons.beanutils.ConversionException
aFormat
- a String
value
org.apache.commons.beanutils.ConversionException
- unable to parse aFormatpublic void setMessageFormat(String aFormat) throws org.apache.commons.beanutils.ConversionException
aFormat
- a String
value
org.apache.commons.beanutils.ConversionException
- unable to parse aFormatpublic void setInfluenceFormat(String aFormat) throws org.apache.commons.beanutils.ConversionException
aFormat
- a String
value
org.apache.commons.beanutils.ConversionException
- unable to parse aFormatpublic void setCheckCPP(boolean aCheckCPP)
aCheckCPP
- true
if C++ comments are checked.public void setCheckC(boolean aCheckC)
aCheckC
- true
if C comments are checked.public boolean accept(AuditEvent aEvent)
accept
in interface Filter
aEvent
- the AudtiEvent to filter.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |