Interface RuleViolationFactory

  • All Known Implementing Classes:

    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 Detail

      • addViolation

        void addViolation​(RuleContext ruleContext,
                          Rule rule,
                          Node node,
                          String message,
                          Object[] args)
        Adds a violation to the report.
        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