Package net.sourceforge.pmd.renderers
Class AbstractIncrementingRenderer
java.lang.Object
net.sourceforge.pmd.properties.AbstractPropertySource
net.sourceforge.pmd.renderers.AbstractRenderer
net.sourceforge.pmd.renderers.AbstractIncrementingRenderer
- All Implemented Interfaces:
PropertySource,Renderer
- Direct Known Subclasses:
CodeClimateRenderer,CSVRenderer,EmacsRenderer,HTMLRenderer,IDEAJRenderer,JsonRenderer,SarifRenderer,TextPadRenderer,TextRenderer,VBHTMLRenderer,XMLRenderer
Abstract base class for
Renderer implementations which can produce
output incrementally for RuleViolations as source files are
processed. Such Renderers are able to produce large reports with
significantly less working memory at any given time. Variations in the
delivery of source file reports are reflected in the output of the
Renderer, so report output can be different between runs.
Only processing errors and suppressed violations are accumulated across all
files. These are intended to be processed in the end() method.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<Report.ConfigurationError>Accumulated configuration errors.protected List<Report.ProcessingError>Accumulated processing errors.protected List<Report.SuppressedViolation>Accumulated suppressed violations.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).voidrenderFileReport(Report report) Render the given file Report.abstract voidrenderFileViolations(Iterator<RuleViolation> violations) Render a series ofRuleViolations.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, newListener
-
Field Details
-
errors
Accumulated processing errors. -
configErrors
Accumulated configuration errors. -
suppressed
Accumulated suppressed violations.
-
-
Constructor Details
-
AbstractIncrementingRenderer
-
-
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
-
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
Description copied from interface:RendererRender 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().- Parameters:
report- A file Report.- Throws:
IOException- See Also:
-
renderFileViolations
Render a series ofRuleViolations.- Parameters:
violations- The iterator of violations to render.- Throws:
IOException
-
end
Description copied from interface:RendererThis method is at the very end of the Rendering process, afterRenderer.renderFileReport(Report).- Throws:
IOException
-