Class PmdCollectingRenderer

java.lang.Object
net.sourceforge.pmd.properties.AbstractPropertySource
net.sourceforge.pmd.renderers.AbstractRenderer
org.apache.maven.plugins.pmd.PmdCollectingRenderer
All Implemented Interfaces:
net.sourceforge.pmd.properties.PropertySource, net.sourceforge.pmd.renderers.Renderer

public class PmdCollectingRenderer extends net.sourceforge.pmd.renderers.AbstractRenderer
A PMD renderer, that collects all violations and processing errors from a pmd execution.
Author:
Andreas Dangel
  • Field Summary

    Fields inherited from class net.sourceforge.pmd.renderers.AbstractRenderer

    description, inputPathPrefixes, name, showSuppressedViolations, writer

    Fields inherited from class net.sourceforge.pmd.properties.AbstractPropertySource

    propertyDescriptors, propertyValuesByDescriptor
  • Constructor Summary

    Constructors
    Constructor
    Description
    Collects all reports from all threads.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.sourceforge.pmd.Report
    Create a new single report with all violations for further rendering into other formats than HTML.
     
    void
    end()
     
    List<net.sourceforge.pmd.Report.ProcessingError>
    Gets all the processing errors.
    getErrorsAsString(boolean withDetails)
    Gets the errors as a single string.
    List<net.sourceforge.pmd.RuleViolation>
    Gets the list of all found violations.
    boolean
    Checks whether any processing errors have been found.
    boolean
    Checks whether any violations have been found.
    void
    renderFileReport(net.sourceforge.pmd.Report report)
     
    void
     
    void
    startFileAnalysis(net.sourceforge.pmd.util.datasource.DataSource dataSource)
     

    Methods inherited from class net.sourceforge.pmd.renderers.AbstractRenderer

    determineFileName, flush, getDescription, getName, getPropertySourceType, getWriter, isShowSuppressedViolations, setDescription, setName, setReportFile, setShowSuppressedViolations, setUseShortNames, setWriter

    Methods inherited from class net.sourceforge.pmd.properties.AbstractPropertySource

    copyPropertyDescriptors, copyPropertyValues, definePropertyDescriptor, dysfunctionReason, getOverriddenPropertiesByPropertyDescriptor, getOverriddenPropertyDescriptors, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, ignoredProperties, isPropertyOverridden, setProperty, setProperty, useDefaultValueFor, usesDefaultValues

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.sourceforge.pmd.properties.PropertySource

    definePropertyDescriptor, dysfunctionReason, getOverriddenPropertiesByPropertyDescriptor, getOverriddenPropertyDescriptors, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, ignoredProperties, isPropertyOverridden, setProperty, setProperty, useDefaultValueFor, usesDefaultValues
  • Constructor Details

    • PmdCollectingRenderer

      public PmdCollectingRenderer()
      Collects all reports from all threads.
  • Method Details

    • renderFileReport

      public void renderFileReport(net.sourceforge.pmd.Report report) throws IOException
      Throws:
      IOException
    • hasViolations

      public boolean hasViolations()
      Checks whether any violations have been found.
      Returns:
      true if at least one violations has been found
    • getViolations

      public List<net.sourceforge.pmd.RuleViolation> getViolations()
      Gets the list of all found violations.
      Returns:
      the violations
    • hasErrors

      public boolean hasErrors()
      Checks whether any processing errors have been found.
      Returns:
      true if any errors have been found
    • getErrors

      public List<net.sourceforge.pmd.Report.ProcessingError> getErrors()
      Gets all the processing errors.
      Returns:
      the errors
    • getErrorsAsString

      public String getErrorsAsString(boolean withDetails)
      Gets the errors as a single string. Each error is in its own line.
      Parameters:
      withDetails - if true then add the error details additionally (contains e.g. the stacktrace)
      Returns:
      the errors as string
    • asReport

      public net.sourceforge.pmd.Report asReport()
      Create a new single report with all violations for further rendering into other formats than HTML.
      Returns:
      the report
    • defaultFileExtension

      public String defaultFileExtension()
    • start

      public void start() throws IOException
      Throws:
      IOException
    • startFileAnalysis

      public void startFileAnalysis(net.sourceforge.pmd.util.datasource.DataSource dataSource)
    • end

      public void end() throws IOException
      Throws:
      IOException