Class Report

    • Method Detail

      • addRuleViolation

        @Deprecated
        @InternalApi
        public void addRuleViolation​(RuleViolation violation)
        Deprecated.
        PMD's way of creating a report is internal and may be changed in pmd 7.
        Adds a new rule violation to the report and notify the listeners.
        Parameters:
        violation - the violation to add
      • addConfigError

        @Deprecated
        @InternalApi
        public void addConfigError​(Report.ConfigurationError error)
        Deprecated.
        PMD's way of creating a report is internal and may be changed in pmd 7.
        Adds a new configuration error to the report.
        Parameters:
        error - the error to add
      • addError

        @Deprecated
        @InternalApi
        public void addError​(Report.ProcessingError error)
        Deprecated.
        PMD's way of creating a report is internal and may be changed in pmd 7.
        Adds a new processing error to the report.
        Parameters:
        error - the error to add
      • merge

        @Deprecated
        public void merge​(Report r)
        Deprecated.
        Convert Renderer to use the reports.
        Merges the given report into this report. This might be necessary, if a summary over all violations is needed as PMD creates one report per file by default.

        This is synchronized on an internal lock (note that other mutation operations are not synchronized, todo for pmd 7).

        Parameters:
        r - the report to be merged into this.
        See Also:
        AbstractAccumulatingRenderer
      • getSuppressedViolations

        public List<Report.SuppressedViolation> getSuppressedViolations()
        Returns an unmodifiable list of violations that were suppressed.
      • getViolations

        public List<RuleViolation> getViolations()
        Returns an unmodifiable list of violations that have been recorded until now. None of those violations were suppressed.

        The violations list is sorted with RuleViolation.DEFAULT_COMPARATOR.

      • getProcessingErrors

        public List<Report.ProcessingError> getProcessingErrors()
        Returns an unmodifiable list of processing errors that have been recorded until now.
      • getConfigurationErrors

        public List<Report.ConfigurationError> getConfigurationErrors()
        Returns an unmodifiable list of configuration errors that have been recorded until now.
      • filterViolations

        @Experimental
        public Report filterViolations​(Predicate<RuleViolation> filter)
        Creates a new report taking all the information from this report, but filtering the violations.
        Parameters:
        filter - when true, the violation will be kept.
        Returns:
        copy of this report
      • union

        @Experimental
        public Report union​(Report other)
        Creates a new report by combining this report with another report. This is similar to merge(Report), but instead a new report is created. The lowest start time and greatest end time are kept in the copy.
        Parameters:
        other - the other report to combine
        Returns: