net.sourceforge.pmd.renderers

## Class AbstractAccumulatingRenderer

- java.lang.Object
- - net.sourceforge.pmd.AbstractPropertySource
  - - net.sourceforge.pmd.renderers.AbstractRenderer
    - - net.sourceforge.pmd.renderers.AbstractAccumulatingRenderer

All Implemented Interfaces:
  PropertySource, Renderer

Direct Known Subclasses:
  SummaryHTMLRenderer, TextColorRenderer, YAHTMLRenderer

    public abstract class AbstractAccumulatingRenderer
    extends AbstractRenderer

Abstract base class for `Renderer` implementations which only produce output once all source files are processed. Such `Renderer`s use working memory proportional to the number of violations found, which can be quite large in some scenarios. Consider using `AbstractIncrementingRenderer` which can use significantly less memory. Subclasses should implement the `end()` method to output the `report`.

See Also:
  `AbstractIncrementingRenderer`

### Field Summary

Fields
`protected Report` `report` The accumulated Report.

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

`description, name, propertyDefinitions, showSuppressedViolations, writer`

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

`propertyDescriptors, propertyValuesByDescriptor`

### Constructor Summary

Constructors
Constructor and Description
`AbstractAccumulatingRenderer(String name, String description)`

### Method Summary

Methods
`abstract void` `end()` Subclasses should output the `report`.
`void` `renderFileReport(Report report)` Render the given file Report.
`void` `start()` This method is called before any source files are processed.
`void` `startFileAnalysis(DataSource dataSource)` This method is called each time a source file is processed.

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

`defineProperty, flush, getDescription, getName, getPropertyDefinitions, getWriter, isShowSuppressedViolations, setDescription, setName, setShowSuppressedViolations, setWriter`

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

`copyPropertyDescriptors, copyPropertyValues, definePropertyDescriptor, dysfunctionReason, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, ignoredProperties, 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.renderers.Renderer

`defaultFileExtension`

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

`definePropertyDescriptor, dysfunctionReason, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, ignoredProperties, setProperty, useDefaultValueFor, usesDefaultValues`

### Field Detail

#### report

    protected Report report

The accumulated Report.

### Constructor Detail

#### AbstractAccumulatingRenderer

    public AbstractAccumulatingRenderer(String name,
                                String description)

### Method Detail

#### start

    public void start()
               throws IOException

This method is called before any source files are processed. The Renderer will have been fully initialized by the time this method is called, so the Writer and other state will be available.

Throws:
  `IOException`

#### startFileAnalysis

    public void startFileAnalysis(DataSource dataSource)

This method is called each time a source file is processed. It is called after `Renderer.start()`, but before `Renderer.renderFileReport(Report)` and `Renderer.end()`. This method may be invoked by different threads which are processing files independently. Therefore, any non-trivial implementation of this method needs to be thread-safe.

Parameters:
  `dataSource` - The source file.

#### renderFileReport

    public void renderFileReport(Report report)
                          throws IOException

Render the given file Report. There may be multiple Report instances which need to be rendered if produced by different threads. It is called after `Renderer.start()` and `Renderer.startFileAnalysis(DataSource)`, but before `Renderer.end()`.

Parameters:
  `report` - A file Report.
Throws:
  `IOException`
See Also:
  `Report`

#### end

    public abstract void end()
                      throws IOException

Subclasses should output the `report`. This method is at the very end of the Rendering process, after `Renderer.renderFileReport(Report)`.

Throws:
  `IOException`