Package net.sourceforge.pmd.lang.rule
Interface RuleViolationFactory
-
- All Known Implementing Classes:
AbstractRuleViolationFactory
public interface RuleViolationFactory
This class handles of producing a Language specific RuleViolation and adding to a Report.Since PMD 6.21.0, implementations of this interface are considered internal API and hence deprecated. Clients should exclusively use this interface and obtain instances through
LanguageVersionHandler.getRuleViolationFactory()
.Since PMD 6.43.0,
RuleContext
has been enriched with methods that should be strongly preferred to using this interface directly. The interface will change a lot in PMD 7.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addViolation(RuleContext ruleContext, Rule rule, Node node, String message, int beginLine, int endLine, Object[] args)
void
addViolation(RuleContext ruleContext, Rule rule, Node node, String message, Object[] args)
Adds a violation to the report.
-
-
-
Method Detail
-
addViolation
void addViolation(RuleContext ruleContext, Rule rule, Node node, String message, Object[] args)
Adds a violation to the report.- Parameters:
ruleContext
- the RuleContextrule
- the rulenode
- the node that produces the violationmessage
- specific message to put in the reportargs
- arguments to embed in the rule violation message
-
addViolation
void addViolation(RuleContext ruleContext, Rule rule, Node node, String message, int beginLine, int endLine, Object[] args)
-
-