Class Violation
- java.lang.Object
-
- org.apache.maven.plugins.checkstyle.Violation
-
class Violation extends java.lang.ObjectHolds data about a single violation and represents the violation itself.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringcategoryprivate java.lang.Stringcolumnprivate java.lang.StringfileThe absolute path of the file containing the violationprivate java.lang.Stringlineprivate java.lang.Stringmessageprotected static java.lang.StringNO_COLUMNIndicates that a column is not set.private java.lang.StringruleNameprivate java.lang.Stringseverityprivate java.lang.StringsourceThe full qualified class name of the checkstyle rule
-
Constructor Summary
Constructors Constructor Description Violation(java.lang.String source, java.lang.String file, java.lang.String line, java.lang.String severity, java.lang.String message, java.lang.String ruleName, java.lang.String category)Creates a violation instance without a column set.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)protected java.lang.StringgetCategory()Returns the category of the current violation.protected java.lang.StringgetColumn()Returns the column in which the violation occurred, if available.protected java.lang.StringgetFile()Returns the absolute file path to the checked file.protected java.lang.StringgetLine()Returns the line in the checked file on which the violation occurred.protected java.lang.StringgetMessage()Returns the message produced by checkstyle for the current violation.protected java.lang.StringgetRuleName()Returns the name of the rule which led to the current violation.protected java.lang.StringgetSeverity()Returns the severity of the current violation.protected java.lang.StringgetSource()Returns the fully qualified class name of the checker rule.inthashCode()protected voidsetColumn(java.lang.String column)Sets the column value for this violation to the given string value.java.lang.StringtoString()
-
-
-
Field Detail
-
NO_COLUMN
protected static final java.lang.String NO_COLUMN
Indicates that a column is not set.- See Also:
- Constant Field Values
-
source
private final java.lang.String source
The full qualified class name of the checkstyle rule
-
file
private final java.lang.String file
The absolute path of the file containing the violation
-
line
private final java.lang.String line
-
column
private java.lang.String column
-
severity
private final java.lang.String severity
-
message
private final java.lang.String message
-
ruleName
private final java.lang.String ruleName
-
category
private final java.lang.String category
-
-
Constructor Detail
-
Violation
Violation(java.lang.String source, java.lang.String file, java.lang.String line, java.lang.String severity, java.lang.String message, java.lang.String ruleName, java.lang.String category)Creates a violation instance without a column set.- Parameters:
source- the fully qualified class name of the checkstyle rulefile- the absolute file path in which the violation occurredline- the line in the file on which the violation occurredseverity- the severity of the violationmessage- the message from checkstyle for this violationruleName- the rule name from which this violation was createdcategory- the category of the checkstyle violation
-
-
Method Detail
-
getSource
protected java.lang.String getSource()
Returns the fully qualified class name of the checker rule.- Returns:
- the fully qualified class name of the checker rule
-
getFile
protected java.lang.String getFile()
Returns the absolute file path to the checked file.- Returns:
- the absolute file path to the checked file
-
getLine
protected java.lang.String getLine()
Returns the line in the checked file on which the violation occurred.- Returns:
- the line in the checked file on which the violation occurred
-
getColumn
protected java.lang.String getColumn()
Returns the column in which the violation occurred, if available.- Returns:
- the column in which the violation occurred, if available. Otherwise returns
NO_COLUMN.
-
setColumn
protected void setColumn(java.lang.String column)
Sets the column value for this violation to the given string value.- Parameters:
column- the column value to set. May benull, which will set it to theNO_COLUMNvalue.
-
getSeverity
protected java.lang.String getSeverity()
Returns the severity of the current violation.- Returns:
- the severity of the current violation
-
getMessage
protected java.lang.String getMessage()
Returns the message produced by checkstyle for the current violation.- Returns:
- the message produced by checkstyle for the current violation
-
getRuleName
protected java.lang.String getRuleName()
Returns the name of the rule which led to the current violation.- Returns:
- the name of the rule which led to the current violation
-
getCategory
protected java.lang.String getCategory()
Returns the category of the current violation.- Returns:
- the category of the current violation
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-