Package net.sourceforge.pmd.renderers
Class AbstractAccumulatingRenderer
java.lang.Object
net.sourceforge.pmd.properties.AbstractPropertySource
net.sourceforge.pmd.renderers.AbstractRenderer
net.sourceforge.pmd.renderers.AbstractAccumulatingRenderer
- All Implemented Interfaces:
PropertySource,Renderer
- Direct Known Subclasses:
SummaryHTMLRenderer,TextColorRenderer,YAHTMLRenderer
Abstract base class for
Renderer implementations which only produce
output once all source files are processed. Such Renderers 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 only implement the outputReport(Report) method to output the
complete Report in the end.
- See Also:
-
Field Summary
Fields inherited from class net.sourceforge.pmd.renderers.AbstractRenderer
description, name, showSuppressedViolations, writer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidend()This method is at the very end of the Rendering process, afterRenderer.renderFileReport(Report).Returns a new analysis listener, that handles violations by rendering them in an implementation-defined way.protected abstract voidoutputReport(Report report) Output the report, called once at the end of the analysis.final voidrenderFileReport(Report report) Render the given file Report.voidstart()This method is called before any source files are processed.voidstartFileAnalysis(TextFile dataSource) This method is called each time a source file is processed.Methods inherited from class net.sourceforge.pmd.renderers.AbstractRenderer
determineFileName, flush, getDescription, getName, getPropertySourceType, getWriter, isShowSuppressedViolations, setDescription, setFileNameRenderer, setName, setReportFile, setShowSuppressedViolations, setWriterMethods inherited from class net.sourceforge.pmd.properties.AbstractPropertySource
definePropertyDescriptor, equals, getOverriddenPropertiesByPropertyDescriptor, getOverriddenPropertyDescriptors, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, hashCode, isPropertyOverridden, setPropertyMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sourceforge.pmd.properties.PropertySource
definePropertyDescriptor, dysfunctionReason, getOverriddenPropertiesByPropertyDescriptor, getOverriddenPropertyDescriptors, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, isPropertyOverridden, setPropertyMethods inherited from interface net.sourceforge.pmd.renderers.Renderer
defaultFileExtension
-
Constructor Details
-
AbstractAccumulatingRenderer
-
-
Method Details
-
start
Description copied from interface:RendererThis 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
-
end
Description copied from interface:RendererThis method is at the very end of the Rendering process, afterRenderer.renderFileReport(Report).- Throws:
IOException
-
startFileAnalysis
Description copied from interface:RendererThis method is called each time a source file is processed. It is called afterRenderer.start(), but beforeRenderer.renderFileReport(Report)andRenderer.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
Render the given file Report. There may be multiple Report instances which need to be rendered if produced by different threads. It is called afterRenderer.start()andRenderer.startFileAnalysis(TextFile), but beforeRenderer.end().- Implementation Note:
- The implementation in this class does nothing. All the reported violations and
errors are accumulated and can be rendered once with
outputReport(Report)in the end. Subclasses ofAbstractAccumulatingRenderercannot override this method anymore. - Parameters:
report- A file Report.- Throws:
IOException- See Also:
-
outputReport
Output the report, called once at the end of the analysis.- Throws:
IOException
-
newListener
Description copied from interface:RendererReturns a new analysis listener, that handles violations by rendering them in an implementation-defined way.- Throws:
IOException
-