com.puppycrawl.tools.checkstyle.filters

Class SuppressElement

public class SuppressElement extends Object implements Filter

This filter processes AuditEvent objects based on the criteria of file, check, module id, line, and column. It rejects an AuditEvent if the following match:

Author: Rick Giles

Constructor Summary
SuppressElement(String aFiles)
Constructs a SuppressElement for a file name pattern.
Method Summary
booleanaccept(AuditEvent aEvent)
booleanequals(Object aObject)
inthashCode()
voidsetChecks(String aChecks)
Set the check class pattern.
voidsetColumns(String aColumns)
Sets the CSV values and ranges for column number filtering.
voidsetLines(String aLines)
Sets the CSV values and ranges for line number filtering.
voidsetModuleId(String aModuleId)
Set the module id for filtering.
StringtoString()

Constructor Detail

SuppressElement

public SuppressElement(String aFiles)
Constructs a SuppressElement for a file name pattern. Must either call setColumns or setModuleId before using this object.

Parameters: aFiles regular expression for names of filtered files.

Throws: PatternSyntaxException if there is an error.

Method Detail

accept

public boolean accept(AuditEvent aEvent)
{@inheritDoc }

equals

public boolean equals(Object aObject)
{@inheritDoc }

hashCode

public int hashCode()
{@inheritDoc }

setChecks

public void setChecks(String aChecks)
Set the check class pattern.

Parameters: aChecks regular expression for filtered check classes.

setColumns

public void setColumns(String aColumns)
Sets the CSV values and ranges for column number filtering. E.g. "1,7-15,18".

Parameters: aColumns CSV values and ranges for column number filtering.

setLines

public void setLines(String aLines)
Sets the CSV values and ranges for line number filtering. E.g. "1,7-15,18".

Parameters: aLines CSV values and ranges for line number filtering.

setModuleId

public void setModuleId(String aModuleId)
Set the module id for filtering. Cannot be null.

Parameters: aModuleId the id

toString

public String toString()
{@inheritDoc }