public abstract class AbstractAccumulatingRenderer extends AbstractRenderer
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
.AbstractIncrementingRenderer
Modifier and Type | Field and Description |
---|---|
protected Report |
report
The accumulated Report.
|
description, name, propertyDefinitions, showSuppressedViolations, writer
propertyDescriptors, propertyValuesByDescriptor
Constructor and Description |
---|
AbstractAccumulatingRenderer(java.lang.String name,
java.lang.String description) |
Modifier and Type | Method and Description |
---|---|
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.
|
defineProperty, flush, getDescription, getName, getPropertyDefinitions, getWriter, isShowSuppressedViolations, setDescription, setName, setShowSuppressedViolations, setWriter
copyPropertyDescriptors, copyPropertyValues, definePropertyDescriptor, dysfunctionReason, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, ignoredProperties, setProperty, useDefaultValueFor, usesDefaultValues
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
defaultFileExtension
definePropertyDescriptor, dysfunctionReason, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, ignoredProperties, setProperty, useDefaultValueFor, usesDefaultValues
protected Report report
public AbstractAccumulatingRenderer(java.lang.String name, java.lang.String description)
public void start() throws java.io.IOException
java.io.IOException
public void startFileAnalysis(DataSource dataSource)
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.dataSource
- The source file.public void renderFileReport(Report report) throws java.io.IOException
Renderer.start()
and
Renderer.startFileAnalysis(DataSource)
, but before Renderer.end()
.report
- A file Report.java.io.IOException
Report
public abstract void end() throws java.io.IOException
report
.
This method is at the very end of the Rendering process, after
Renderer.renderFileReport(Report)
.java.io.IOException
Copyright © 2002-2014 InfoEther. All Rights Reserved.