com.puppycrawl.tools.checkstyle.filters
Class SuppressElement

java.lang.Object
  extended bycom.puppycrawl.tools.checkstyle.filters.SuppressElement
All Implemented Interfaces:
Filter

public class SuppressElement
extends java.lang.Object
implements Filter

This filter accepts AuditEvents according to file, check, line, and column conditions. It rejects an AuditEvent if the event's file name and check name match the filter's file name and check name patterns, and the event's line is in the filter's line CSV or the check's columns is in the filter's column CSV.

Author:
Rick Giles

Constructor Summary
SuppressElement(java.lang.String aFiles, java.lang.String aChecks)
          Constructs a SuppressElement for a file name pattern and and a check class pattern.
 
Method Summary
 boolean accept(AuditEvent aEvent)
          Determines whether or not a filtered AuditEvent is accepted.
 boolean equals(java.lang.Object aObject)
           
 int hashCode()
           
 void setColumns(java.lang.String aColumns)
          Sets the CSV values and ranges for column number filtering.
 void setLines(java.lang.String aLines)
          Sets the CSV values and ranges for line number filtering.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SuppressElement

public SuppressElement(java.lang.String aFiles,
                       java.lang.String aChecks)
                throws org.apache.regexp.RESyntaxException
Constructs a SuppressElement for a file name pattern and and a check class pattern.

Parameters:
aFiles - regular expression for names of filtered files.
aChecks - regular expression for filtered check classes.
Throws:
org.apache.regexp.RESyntaxException - if there is an error.
Method Detail

setLines

public void setLines(java.lang.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.

setColumns

public void setColumns(java.lang.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.

accept

public boolean accept(AuditEvent aEvent)
Description copied from interface: Filter
Determines whether or not a filtered AuditEvent is accepted.

Specified by:
accept in interface Filter
Parameters:
aEvent - the AudtiEvent to filter.
Returns:
true if the aEvent is accepted.
See Also:
Filter

toString

public java.lang.String toString()
See Also:
Object.toString()

hashCode

public int hashCode()
See Also:
Object.hashCode()

equals

public boolean equals(java.lang.Object aObject)
See Also:
Object.equals(java.lang.Object)

Back to the Checkstyle Home Page