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().

    • Method Detail

      • addViolation

        void addViolation​(RuleContext ruleContext,
                          Rule rule,
                          Node node,
                          String message,
                          Object[] args)
        Adds a violation to the report.
        Parameters:
        ruleContext - the RuleContext
        rule - the rule
        node - the node that produces the violation
        message - specific message to put in the report
        args - arguments to embed in the rule violation message