com.puppycrawl.tools.checkstyle.filters
Class SuppressionCommentFilter.Tag

java.lang.Object
  extended bycom.puppycrawl.tools.checkstyle.filters.SuppressionCommentFilter.Tag
All Implemented Interfaces:
java.lang.Comparable
Enclosing class:
SuppressionCommentFilter

public class SuppressionCommentFilter.Tag
extends java.lang.Object
implements java.lang.Comparable

A Tag holds a suppression comment and its location, and determines whether the supression turns checkstyle reporting on or off.

Author:
Rick Giles

Constructor Summary
SuppressionCommentFilter.Tag(int aLine, int aColumn, java.lang.String aText, boolean aOn)
          Constructs a tag.
 
Method Summary
 int compareTo(java.lang.Object aObject)
          Compares the position of this tag in the file with the position of another tag.
 int getColumn()
          Determines the column number of the tag in the source file.
 int getLine()
           
 java.lang.String getText()
           
 boolean isMatch(AuditEvent aEvent)
          Determines whether the source of an audit event matches the text of this tag.
 boolean isOn()
          Determines whether the suppression turns checkstyle reporting on or off.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SuppressionCommentFilter.Tag

public SuppressionCommentFilter.Tag(int aLine,
                                    int aColumn,
                                    java.lang.String aText,
                                    boolean aOn)
                             throws org.apache.commons.beanutils.ConversionException
Constructs a tag.

Parameters:
aLine - the line number.
aColumn - the column number.
aText - the text of the suppression.
aOn - true if the tag turns checkstyle reporting.
Throws:
org.apache.commons.beanutils.ConversionException - if unable to parse expanded aText. on.
Method Detail

getText

public java.lang.String getText()
Returns:
the text of the tag.

getLine

public int getLine()
Returns:
the line number of the tag in the source file.

getColumn

public int getColumn()
Determines the column number of the tag in the source file. Will be 0 for all lines of multiline comment, except the first line.

Returns:
the column number of the tag in the source file.

isOn

public boolean isOn()
Determines whether the suppression turns checkstyle reporting on or off.

Returns:
trueif the suppression turns reporting on.

compareTo

public int compareTo(java.lang.Object aObject)
Compares the position of this tag in the file with the position of another tag.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
aObject - the tag to compare with this one.
Returns:
a negative number if this tag is before the other tag, 0 if they are at the same position, and a positive number if this tag is after the other tag.
See Also:
Comparable.compareTo(java.lang.Object)

isMatch

public boolean isMatch(AuditEvent aEvent)
Determines whether the source of an audit event matches the text of this tag.

Parameters:
aEvent - the AuditEvent to check.
Returns:
true if the source of aEvent matches the text of this tag.

Back to the Checkstyle Home Page