org.codehaus.mojo.findbugs
Class FindbugsReportGenerator

java.lang.Object
  extended by org.codehaus.mojo.findbugs.FindbugsReportGenerator
All Implemented Interfaces:
groovy.lang.GroovyObject, FindBugsInfo

public class FindbugsReportGenerator
extends java.lang.Object
implements groovy.lang.GroovyObject, FindBugsInfo

The reporter controls the generation of the FindBugs report. It contains call back methods which gets called by FindBugs if a bug is found.

Version:
$Id: FindbugsReportGenerator.groovy Z gleclaire $
Author:
Garvin LeClaire

Field Summary
 
Fields inherited from interface org.codehaus.mojo.findbugs.FindBugsInfo
BUNDLE_NAME, DESCRIPTION_KEY, findbugsEfforts, findbugsPriority, findbugsThresholds, JAVA_REGEX_PATTERN, JAVA_SOURCES_KEY, PLUGIN_NAME, SOURCE_ROOT_KEY, TEST_SOURCE_ROOT_KEY
 
Constructor Summary
FindbugsReportGenerator(org.apache.maven.doxia.sink.Sink sink, java.util.ResourceBundle bundle, java.io.File basedir, org.apache.maven.doxia.tools.SiteTool siteTool)
          Default constructor.
 
Method Summary
protected  java.lang.String assembleJxrHyperlink(groovy.util.slurpersupport.GPathResult line)
          Assembles the hyperlink to point to the source code.
 void generateReport()
           
 java.io.File getBasedir()
           
 java.util.List getBugClasses()
           
 int getBugCount()
           
 java.util.ResourceBundle getBundle()
           
static java.lang.String getCOLUMN_BUG_KEY()
           
static java.lang.String getCOLUMN_BUGS_KEY()
           
static java.lang.String getCOLUMN_CATEGORY_KEY()
           
static java.lang.String getCOLUMN_CLASS_KEY()
           
static java.lang.String getCOLUMN_CLASSES_KEY()
           
static java.lang.String getCOLUMN_DETAILS_KEY()
           
static java.lang.String getCOLUMN_ERRORS_KEY()
           
static java.lang.String getCOLUMN_FILES_KEY()
           
static java.lang.String getCOLUMN_LINE_KEY()
           
static java.lang.String getCOLUMN_MISSINGCLASSES_KEY()
           
static java.lang.String getCOLUMN_PRIORITY_KEY()
           
 java.util.List getCompileSourceRoots()
           
 java.lang.String getCurrentClassName()
           
static java.lang.String getDETAILSLINK_KEY()
           
static java.lang.String getEFFORT_KEY()
           
 java.lang.String getEffort()
           
 int getErrorCount()
           
 int getFileCount()
           
static java.lang.String getFILES_KEY()
           
 groovy.util.slurpersupport.GPathResult getFindbugsResults()
           
 boolean getIncludeTests()
           
 boolean getIsJXRReportEnabled()
           
static java.lang.String getLINK_KEY()
           
static java.lang.String getLINKTITLE_KEY()
           
 org.apache.maven.plugin.logging.Log getLog()
           
 groovy.lang.MetaClass getMetaClass()
           
 boolean getMIsCurrentClassReportOpened()
           
 int getMissingClassCount()
           
 java.util.Set getMissingClassSet()
           
static java.lang.String getNAME_KEY()
           
static java.lang.String getNOLINE_KEY()
           
 java.io.File getOutputDirectory()
           
 java.lang.Object getProperty(java.lang.String name)
           
static java.lang.String getREPORT_TITLE_KEY()
           
protected  java.lang.String getReportTitle()
          Gets the report title.
 org.apache.maven.doxia.sink.Sink getSink()
           
 org.apache.maven.doxia.tools.SiteTool getSiteTool()
           
static java.lang.String getSUMMARY_KEY()
           
 java.util.List getTestSourceRoots()
           
static java.lang.String getTHRESHOLD_KEY()
           
 java.lang.String getThreshold()
           
static java.lang.String getURL_SEPARATOR()
           
static java.lang.String getVERSIONTITLE_KEY()
           
 java.io.File getXrefLocation()
           
 java.io.File getXrefTestLocation()
           
 java.lang.Object invokeMethod(java.lang.String name, java.lang.Object args)
           
 boolean isIncludeTests()
           
 boolean isIsJXRReportEnabled()
           
 boolean isMIsCurrentClassReportOpened()
           
protected  void openClassReportSection(java.lang.String bugClass)
          Initialised a bug report section in the report for a particular class.
 void printBody()
           
protected  void printBug(java.lang.String bugClass)
          Print the bug collection to a line in the table
protected  void printFilesSummary()
          Print the File Summary Section.
protected  void printSummary()
          Print the Summary Section.
 void setBasedir(java.io.File value)
           
 void setBugClasses(java.util.List value)
           
 void setBugCount(int value)
           
 void setBundle(java.util.ResourceBundle value)
           
 void setCompileSourceRoots(java.util.List value)
           
 void setCurrentClassName(java.lang.String value)
           
 void setEffort(java.lang.String value)
           
 void setErrorCount(int value)
           
 void setFileCount(int value)
           
 void setFindbugsResults(groovy.util.slurpersupport.GPathResult value)
           
 void setIncludeTests(boolean value)
           
 void setIsJXRReportEnabled(boolean value)
           
 void setLog(org.apache.maven.plugin.logging.Log value)
           
 void setMetaClass(groovy.lang.MetaClass metaClass)
           
 void setMIsCurrentClassReportOpened(boolean value)
           
 void setMissingClassCount(int value)
           
 void setMissingClassSet(java.util.Set value)
           
 void setOutputDirectory(java.io.File value)
           
 void setProperty(java.lang.String name, java.lang.Object value)
           
 void setSink(org.apache.maven.doxia.sink.Sink value)
           
 void setSiteTool(org.apache.maven.doxia.tools.SiteTool value)
           
 void setTestSourceRoots(java.util.List value)
           
 void setThreshold(java.lang.String value)
           
 void setXrefLocation(java.io.File value)
           
 void setXrefTestLocation(java.io.File value)
           
protected  java.lang.String valueForLine(groovy.util.slurpersupport.GPathResult line)
          Return the value to display.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FindbugsReportGenerator

public FindbugsReportGenerator(org.apache.maven.doxia.sink.Sink sink,
                               java.util.ResourceBundle bundle,
                               java.io.File basedir,
                               org.apache.maven.doxia.tools.SiteTool siteTool)
Default constructor.

Parameters:
sink - The sink to generate the report.
bundle - The resource bundle to get the messages from.
basedir - The project base directory.
siteTool - Doxia SiteTool Handle.
Method Detail

getNOLINE_KEY

public static final java.lang.String getNOLINE_KEY()

getCOLUMN_LINE_KEY

public static final java.lang.String getCOLUMN_LINE_KEY()

getCOLUMN_BUG_KEY

public static final java.lang.String getCOLUMN_BUG_KEY()

getCOLUMN_BUGS_KEY

public static final java.lang.String getCOLUMN_BUGS_KEY()

getCOLUMN_CATEGORY_KEY

public static final java.lang.String getCOLUMN_CATEGORY_KEY()

getCOLUMN_PRIORITY_KEY

public static final java.lang.String getCOLUMN_PRIORITY_KEY()

getCOLUMN_DETAILS_KEY

public static final java.lang.String getCOLUMN_DETAILS_KEY()

getREPORT_TITLE_KEY

public static final java.lang.String getREPORT_TITLE_KEY()

getLINKTITLE_KEY

public static final java.lang.String getLINKTITLE_KEY()

getLINK_KEY

public static final java.lang.String getLINK_KEY()

getNAME_KEY

public static final java.lang.String getNAME_KEY()

getFILES_KEY

public static final java.lang.String getFILES_KEY()

getTHRESHOLD_KEY

public static final java.lang.String getTHRESHOLD_KEY()

getURL_SEPARATOR

public static final java.lang.String getURL_SEPARATOR()

getEFFORT_KEY

public static final java.lang.String getEFFORT_KEY()

getDETAILSLINK_KEY

public static final java.lang.String getDETAILSLINK_KEY()

getVERSIONTITLE_KEY

public static final java.lang.String getVERSIONTITLE_KEY()

getSUMMARY_KEY

public static final java.lang.String getSUMMARY_KEY()

getCOLUMN_CLASS_KEY

public static final java.lang.String getCOLUMN_CLASS_KEY()

getCOLUMN_CLASSES_KEY

public static final java.lang.String getCOLUMN_CLASSES_KEY()

getCOLUMN_ERRORS_KEY

public static final java.lang.String getCOLUMN_ERRORS_KEY()

getCOLUMN_FILES_KEY

public static final java.lang.String getCOLUMN_FILES_KEY()

getCOLUMN_MISSINGCLASSES_KEY

public static final java.lang.String getCOLUMN_MISSINGCLASSES_KEY()

getSink

public org.apache.maven.doxia.sink.Sink getSink()

setSink

public void setSink(org.apache.maven.doxia.sink.Sink value)

getBundle

public java.util.ResourceBundle getBundle()

setBundle

public void setBundle(java.util.ResourceBundle value)

getLog

public org.apache.maven.plugin.logging.Log getLog()

setLog

public void setLog(org.apache.maven.plugin.logging.Log value)

getThreshold

public java.lang.String getThreshold()

setThreshold

public void setThreshold(java.lang.String value)

getEffort

public java.lang.String getEffort()

setEffort

public void setEffort(java.lang.String value)

getCurrentClassName

public java.lang.String getCurrentClassName()

setCurrentClassName

public void setCurrentClassName(java.lang.String value)

getMIsCurrentClassReportOpened

public boolean getMIsCurrentClassReportOpened()

isMIsCurrentClassReportOpened

public boolean isMIsCurrentClassReportOpened()

setMIsCurrentClassReportOpened

public void setMIsCurrentClassReportOpened(boolean value)

getIsJXRReportEnabled

public boolean getIsJXRReportEnabled()

isIsJXRReportEnabled

public boolean isIsJXRReportEnabled()

setIsJXRReportEnabled

public void setIsJXRReportEnabled(boolean value)

getBugCount

public int getBugCount()

setBugCount

public void setBugCount(int value)

getMissingClassCount

public int getMissingClassCount()

setMissingClassCount

public void setMissingClassCount(int value)

getFileCount

public int getFileCount()

setFileCount

public void setFileCount(int value)

getMissingClassSet

public java.util.Set getMissingClassSet()

setMissingClassSet

public void setMissingClassSet(java.util.Set value)

getErrorCount

public int getErrorCount()

setErrorCount

public void setErrorCount(int value)

getOutputDirectory

public java.io.File getOutputDirectory()

setOutputDirectory

public void setOutputDirectory(java.io.File value)

getXrefLocation

public java.io.File getXrefLocation()

setXrefLocation

public void setXrefLocation(java.io.File value)

getXrefTestLocation

public java.io.File getXrefTestLocation()

setXrefTestLocation

public void setXrefTestLocation(java.io.File value)

getCompileSourceRoots

public java.util.List getCompileSourceRoots()

setCompileSourceRoots

public void setCompileSourceRoots(java.util.List value)

getTestSourceRoots

public java.util.List getTestSourceRoots()

setTestSourceRoots

public void setTestSourceRoots(java.util.List value)

getIncludeTests

public boolean getIncludeTests()

isIncludeTests

public boolean isIncludeTests()

setIncludeTests

public void setIncludeTests(boolean value)

getSiteTool

public org.apache.maven.doxia.tools.SiteTool getSiteTool()

setSiteTool

public void setSiteTool(org.apache.maven.doxia.tools.SiteTool value)

getBasedir

public java.io.File getBasedir()

setBasedir

public void setBasedir(java.io.File value)

getFindbugsResults

public groovy.util.slurpersupport.GPathResult getFindbugsResults()

setFindbugsResults

public void setFindbugsResults(groovy.util.slurpersupport.GPathResult value)

getBugClasses

public java.util.List getBugClasses()

setBugClasses

public void setBugClasses(java.util.List value)

printBody

public void printBody()
See Also:
edu.umd.cs.findbugs.BugReporter#finish()

printBug

protected void printBug(java.lang.String bugClass)
Print the bug collection to a line in the table

Parameters:
bugInstance - the bug to print

assembleJxrHyperlink

protected java.lang.String assembleJxrHyperlink(groovy.util.slurpersupport.GPathResult line)
Assembles the hyperlink to point to the source code.

Parameters:
line - The line number object with the bug.
lineNumber - The line number to show in the hyperlink.
Returns:
The hyperlink which points to the code.

getReportTitle

protected java.lang.String getReportTitle()
Gets the report title.

Returns:
The report title.

openClassReportSection

protected void openClassReportSection(java.lang.String bugClass)
Initialised a bug report section in the report for a particular class.


printSummary

protected void printSummary()
Print the Summary Section.


printFilesSummary

protected void printFilesSummary()
Print the File Summary Section.


generateReport

public void generateReport()

valueForLine

protected java.lang.String valueForLine(groovy.util.slurpersupport.GPathResult line)
Return the value to display. If FindBugs does not provide a line number, a default message is returned. The line number otherwise.

Parameters:
line - The line to get the value from.
Returns:
The line number the bug appears or a statement that there is no source line available.

getMetaClass

public groovy.lang.MetaClass getMetaClass()
Specified by:
getMetaClass in interface groovy.lang.GroovyObject

setMetaClass

public void setMetaClass(groovy.lang.MetaClass metaClass)
Specified by:
setMetaClass in interface groovy.lang.GroovyObject

invokeMethod

public java.lang.Object invokeMethod(java.lang.String name,
                                     java.lang.Object args)
Specified by:
invokeMethod in interface groovy.lang.GroovyObject

getProperty

public java.lang.Object getProperty(java.lang.String name)
Specified by:
getProperty in interface groovy.lang.GroovyObject

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
Specified by:
setProperty in interface groovy.lang.GroovyObject


Copyright © 2005-2011 Codehaus. All Rights Reserved.