Class Violation
java.lang.Object
org.apache.maven.plugins.checkstyle.Violation
Holds data about a single violation and represents the violation itself.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
private String
private final String
The absolute path of the file containing the violationprivate final String
private final String
protected static final String
Indicates that a column is not set.private final String
private final String
private final String
The full qualified class name of the checkstyle rule -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
protected String
Returns the category of the current violation.protected String
Returns the column in which the violation occurred, if available.protected String
getFile()
Returns the absolute file path to the checked file.protected String
getLine()
Returns the line in the checked file on which the violation occurred.protected String
Returns the message produced by checkstyle for the current violation.protected String
Returns the name of the rule which led to the current violation.protected String
Returns the severity of the current violation.protected String
Returns the fully qualified class name of the checker rule.int
hashCode()
protected void
Sets the column value for this violation to the given string value.toString()
-
Field Details
-
NO_COLUMN
Indicates that a column is not set.- See Also:
-
source
The full qualified class name of the checkstyle rule -
file
The absolute path of the file containing the violation -
line
-
column
-
severity
-
message
-
ruleName
-
category
-
-
Constructor Details
-
Violation
Violation(String source, String file, String line, String severity, String message, String ruleName, 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 Details
-
getSource
Returns the fully qualified class name of the checker rule.- Returns:
- the fully qualified class name of the checker rule
-
getFile
Returns the absolute file path to the checked file.- Returns:
- the absolute file path to the checked file
-
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
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
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_COLUMN
value.
-
getSeverity
Returns the severity of the current violation.- Returns:
- the severity of the current violation
-
getMessage
Returns the message produced by checkstyle for the current violation.- Returns:
- the message produced by checkstyle for the current violation
-
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
Returns the category of the current violation.- Returns:
- the category of the current violation
-
equals
-
hashCode
public int hashCode() -
toString
-