Package org.apache.maven.plugins.pmd
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, writerFields inherited from class net.sourceforge.pmd.properties.AbstractPropertySource
propertyDescriptors, propertyValuesByDescriptor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.sourceforge.pmd.ReportasReport()Create a new single report with all violations for further rendering into other formats than HTML.voidend()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.booleanChecks whether any processing errors have been found.booleanChecks whether any violations have been found.voidrenderFileReport(net.sourceforge.pmd.Report report) voidstart()voidstartFileAnalysis(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, setWriterMethods inherited from class net.sourceforge.pmd.properties.AbstractPropertySource
copyPropertyDescriptors, copyPropertyValues, definePropertyDescriptor, dysfunctionReason, getOverriddenPropertiesByPropertyDescriptor, getOverriddenPropertyDescriptors, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, ignoredProperties, isPropertyOverridden, setProperty, setProperty, useDefaultValueFor, usesDefaultValuesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
- Throws:
IOException
-
hasViolations
public boolean hasViolations()Checks whether any violations have been found.- Returns:
trueif at least one violations has been found
-
getViolations
Gets the list of all found violations.- Returns:
- the violations
-
hasErrors
public boolean hasErrors()Checks whether any processing errors have been found.- Returns:
trueif any errors have been found
-
getErrors
Gets all the processing errors.- Returns:
- the errors
-
getErrorsAsString
Gets the errors as a single string. Each error is in its own line.- Parameters:
withDetails- iftruethen 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
-
start
- Throws:
IOException
-
startFileAnalysis
public void startFileAnalysis(net.sourceforge.pmd.util.datasource.DataSource dataSource) -
end
- Throws:
IOException
-