Groovy Documentation

org.codenarc.report
Class HtmlReportWriter

java.lang.Object
  org.codenarc.report.AbstractReportWriter
      org.codenarc.report.HtmlReportWriter

class HtmlReportWriter
extends AbstractReportWriter

ReportWriter that generates an HTML report.

The default localized messages, including rule descriptions, are read from the "codenarc-base-messages" ResourceBundle. You can override these messages using the normal ResourceBundle mechanisms (i.e. creating a locale-specific resource bundle file on the classpath, such as "codenarc-base-messages_de"). You can optionally add rule descriptions for custom rules by placing them within a "codenarc-messages.properties" file on the classpath, with entries of the form: {rule-name}.description=..."

author:
Chris Mair
version:
$Revision: 317 $ - $Date: 2010-04-09 14:39:04 -0400 (Fri, 09 Apr 2010) $


Property Summary
static def DEFAULT_OUTPUT_FILE

String defaultOutputFile

String title

 
Constructor Summary
HtmlReportWriter()

 
Method Summary
protected String formatSourceLine(String sourceLine, int startColumn = 0)

Format and trim the source line.

protected boolean isDirectoryContainingFiles(Results results)

Return true if the Results represents a directory that contains at least one file

protected boolean isDirectoryContainingFilesWithViolations(Results results)

Return true if the Results represents a directory that contains at least one file with one or more violations.

String toString()

void writeReport(Writer writer, AnalysisContext analysisContext, Results results)

Write out a report to the specified Writer for the analysis results

 
Methods inherited from class AbstractReportWriter
getCodeNarcVersion, getDescriptionForRule, getFormattedTimestamp, getHtmlDescriptionForRule, getResourceBundleString, getSortedRules, initializeDefaultResourceBundle, isEnabled, writeReport
 

Property Detail

DEFAULT_OUTPUT_FILE

public static final def DEFAULT_OUTPUT_FILE


defaultOutputFile

String defaultOutputFile


title

String title


 
Constructor Detail

HtmlReportWriter

HtmlReportWriter()


 
Method Detail

formatSourceLine

protected String formatSourceLine(String sourceLine, int startColumn = 0)
Format and trim the source line. If the whole line fits, then include the whole line (trimmed). Otherwise, remove characters from the middle to truncate to the max length.
param:
sourceLine - the source line to format
param:
startColumn - the starting column index; used to truncate the line if it's too long; defaults to 0
return:
the formatted and trimmed source line


isDirectoryContainingFiles

protected boolean isDirectoryContainingFiles(Results results)
Return true if the Results represents a directory that contains at least one file
param:
results - the Results


isDirectoryContainingFilesWithViolations

protected boolean isDirectoryContainingFilesWithViolations(Results results)
Return true if the Results represents a directory that contains at least one file with one or more violations.
param:
results - the Results


toString

String toString()


writeReport

void writeReport(Writer writer, AnalysisContext analysisContext, Results results)
Write out a report to the specified Writer for the analysis results
param:
analysisContext - the AnalysisContext containing the analysis configuration information
param:
results - the analysis results


 

Groovy Documentation