Package net.sourceforge.pmd.lang.rule
Class ParametricRuleViolation<T extends Node>
- java.lang.Object
-
- net.sourceforge.pmd.lang.rule.ParametricRuleViolation<T>
-
- All Implemented Interfaces:
RuleViolation
public class ParametricRuleViolation<T extends Node> extends Object implements RuleViolation
-
-
Field Summary
Fields Modifier and Type Field Description protected intbeginColumnprotected intbeginLineprotected StringclassNameprotected Stringdescriptionprotected intendColumnprotected intendLineprotected Stringfilenameprotected StringmethodNameprotected StringpackageNameprotected Ruleruleprotected booleansuppressedprotected StringvariableName
-
Constructor Summary
Constructors Constructor Description ParametricRuleViolation(Rule theRule, RuleContext ctx, T node, String message)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringexpandVariables(String message)intgetBeginColumn()Get the column number of the begin line in the source file in which this violation was identified.intgetBeginLine()Get the begin line number in the source file in which this violation was identified.StringgetClassName()Get the name of the Class in which this violation was identified.StringgetDescription()Get the description of this violation.intgetEndColumn()Get the column number of the end line in the source file in which this violation was identified.intgetEndLine()Get the end line number in the source file in which this violation was identified.StringgetFilename()Get the source file name in which this violation was identified.StringgetMethodName()Get the method name in which this violation was identified.StringgetPackageName()Get the package name of the Class in which this violation was identified.RulegetRule()Get the Rule which identified this violation.StringgetVariableName()Get the variable name on which this violation was identified.protected StringgetVariableValue(String name)booleanisSuppressed()Indicates whether this violation has been suppressed.protected booleanisVariable(String name)voidsetLines(int theBeginLine, int theEndLine)StringtoString()
-
-
-
Field Detail
-
rule
protected final Rule rule
-
description
protected final String description
-
suppressed
protected boolean suppressed
-
filename
protected String filename
-
beginLine
protected int beginLine
-
beginColumn
protected int beginColumn
-
endLine
protected int endLine
-
endColumn
protected int endColumn
-
packageName
protected String packageName
-
className
protected String className
-
methodName
protected String methodName
-
variableName
protected String variableName
-
-
Constructor Detail
-
ParametricRuleViolation
public ParametricRuleViolation(Rule theRule, RuleContext ctx, T node, String message)
-
-
Method Detail
-
isVariable
protected boolean isVariable(String name)
-
getRule
public Rule getRule()
Description copied from interface:RuleViolationGet the Rule which identified this violation.- Specified by:
getRulein interfaceRuleViolation- Returns:
- The identifying Rule.
-
getDescription
public String getDescription()
Description copied from interface:RuleViolationGet the description of this violation.- Specified by:
getDescriptionin interfaceRuleViolation- Returns:
- The description.
-
isSuppressed
public boolean isSuppressed()
Description copied from interface:RuleViolationIndicates whether this violation has been suppressed.- Specified by:
isSuppressedin interfaceRuleViolation- Returns:
trueif this violation is suppressed,falseotherwise.
-
getFilename
public String getFilename()
Description copied from interface:RuleViolationGet the source file name in which this violation was identified.- Specified by:
getFilenamein interfaceRuleViolation- Returns:
- The source file name.
-
getBeginLine
public int getBeginLine()
Description copied from interface:RuleViolationGet the begin line number in the source file in which this violation was identified.- Specified by:
getBeginLinein interfaceRuleViolation- Returns:
- Begin line number.
-
getBeginColumn
public int getBeginColumn()
Description copied from interface:RuleViolationGet the column number of the begin line in the source file in which this violation was identified.- Specified by:
getBeginColumnin interfaceRuleViolation- Returns:
- Begin column number.
-
getEndLine
public int getEndLine()
Description copied from interface:RuleViolationGet the end line number in the source file in which this violation was identified.- Specified by:
getEndLinein interfaceRuleViolation- Returns:
- End line number.
-
getEndColumn
public int getEndColumn()
Description copied from interface:RuleViolationGet the column number of the end line in the source file in which this violation was identified.- Specified by:
getEndColumnin interfaceRuleViolation- Returns:
- End column number.
-
getPackageName
public String getPackageName()
Description copied from interface:RuleViolationGet the package name of the Class in which this violation was identified.- Specified by:
getPackageNamein interfaceRuleViolation- Returns:
- The package name.
-
getClassName
public String getClassName()
Description copied from interface:RuleViolationGet the name of the Class in which this violation was identified.- Specified by:
getClassNamein interfaceRuleViolation- Returns:
- The Class name.
-
getMethodName
public String getMethodName()
Description copied from interface:RuleViolationGet the method name in which this violation was identified.- Specified by:
getMethodNamein interfaceRuleViolation- Returns:
- The method name.
-
getVariableName
public String getVariableName()
Description copied from interface:RuleViolationGet the variable name on which this violation was identified.- Specified by:
getVariableNamein interfaceRuleViolation- Returns:
- The variable name.
-
setLines
public void setLines(int theBeginLine, int theEndLine)
-
-