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 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, 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, ResourceBundle bundle, File basedir, org.apache.maven.doxia.tools.SiteTool siteTool)
          Default constructor.
 
Method Summary
protected  String assembleJxrHyperlink(groovy.util.slurpersupport.GPathResult line)
          Assembles the hyperlink to point to the source code.
 void generateReport()
           
 File getBasedir()
           
 List getBugClasses()
           
 int getBugCount()
           
 ResourceBundle getBundle()
           
static String getCOLUMN_BUG_KEY()
           
static String getCOLUMN_BUGS_KEY()
           
static String getCOLUMN_CATEGORY_KEY()
           
static String getCOLUMN_CLASS_KEY()
           
static String getCOLUMN_CLASSES_KEY()
           
static String getCOLUMN_DETAILS_KEY()
           
static String getCOLUMN_ERRORS_KEY()
           
static String getCOLUMN_FILES_KEY()
           
static String getCOLUMN_LINE_KEY()
           
static String getCOLUMN_MISSINGCLASSES_KEY()
           
static String getCOLUMN_PRIORITY_KEY()
           
 List getCompileSourceRoots()
           
 String getCurrentClassName()
           
static String getDETAILSLINK_KEY()
           
static String getEFFORT_KEY()
           
 String getEffort()
           
 int getErrorCount()
           
 int getFileCount()
           
static String getFILES_KEY()
           
 groovy.util.slurpersupport.GPathResult getFindbugsResults()
           
 boolean getIncludeTests()
           
 boolean getIsJXRReportEnabled()
           
static String getLINK_KEY()
           
static String getLINKTITLE_KEY()
           
 org.apache.maven.plugin.logging.Log getLog()
           
 groovy.lang.MetaClass getMetaClass()
           
 boolean getMIsCurrentClassReportOpened()
           
 int getMissingClassCount()
           
 Set getMissingClassSet()
           
static String getNAME_KEY()
           
static String getNOLINE_KEY()
           
 File getOutputDirectory()
           
 Object getProperty(String name)
           
static String getREPORT_TITLE_KEY()
           
protected  String getReportTitle()
          Gets the report title.
 org.apache.maven.doxia.sink.Sink getSink()
           
 org.apache.maven.doxia.tools.SiteTool getSiteTool()
           
static String getSUMMARY_KEY()
           
 List getTestSourceRoots()
           
static String getTHRESHOLD_KEY()
           
 String getThreshold()
           
static String getURL_SEPARATOR()
           
static String getVERSIONTITLE_KEY()
           
 File getXrefLocation()
           
 File getXrefTestLocation()
           
 Object invokeMethod(String name, Object args)
           
 boolean isIncludeTests()
           
 boolean isIsJXRReportEnabled()
           
 boolean isMIsCurrentClassReportOpened()
           
protected  void openClassReportSection(String bugClass)
          Initialised a bug report section in the report for a particular class.
 void printBody()
           
protected  void printBug(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(File value)
           
 void setBugClasses(List value)
           
 void setBugCount(int value)
           
 void setBundle(ResourceBundle value)
           
 void setCompileSourceRoots(List value)
           
 void setCurrentClassName(String value)
           
 void setEffort(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(Set value)
           
 void setOutputDirectory(File value)
           
 void setProperty(String name, Object value)
           
 void setSink(org.apache.maven.doxia.sink.Sink value)
           
 void setSiteTool(org.apache.maven.doxia.tools.SiteTool value)
           
 void setTestSourceRoots(List value)
           
 void setThreshold(String value)
           
 void setXrefLocation(File value)
           
 void setXrefTestLocation(File value)
           
 
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,
                               ResourceBundle bundle,
                               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.
log - The logger.
threshold - The threshold for the report.
isJXRReportEnabled - Is the jxr report plugin enabled.
effort - The used effort.
Method Detail

getNOLINE_KEY

public static final String getNOLINE_KEY()

getCOLUMN_LINE_KEY

public static final String getCOLUMN_LINE_KEY()

getCOLUMN_BUG_KEY

public static final String getCOLUMN_BUG_KEY()

getCOLUMN_BUGS_KEY

public static final String getCOLUMN_BUGS_KEY()

getCOLUMN_CATEGORY_KEY

public static final String getCOLUMN_CATEGORY_KEY()

getCOLUMN_PRIORITY_KEY

public static final String getCOLUMN_PRIORITY_KEY()

getCOLUMN_DETAILS_KEY

public static final String getCOLUMN_DETAILS_KEY()

getREPORT_TITLE_KEY

public static final String getREPORT_TITLE_KEY()

getLINKTITLE_KEY

public static final String getLINKTITLE_KEY()

getLINK_KEY

public static final String getLINK_KEY()

getNAME_KEY

public static final String getNAME_KEY()

getFILES_KEY

public static final String getFILES_KEY()

getTHRESHOLD_KEY

public static final String getTHRESHOLD_KEY()

getURL_SEPARATOR

public static final String getURL_SEPARATOR()

getEFFORT_KEY

public static final String getEFFORT_KEY()

getDETAILSLINK_KEY

public static final String getDETAILSLINK_KEY()

getVERSIONTITLE_KEY

public static final String getVERSIONTITLE_KEY()

getSUMMARY_KEY

public static final String getSUMMARY_KEY()

getCOLUMN_CLASS_KEY

public static final String getCOLUMN_CLASS_KEY()

getCOLUMN_CLASSES_KEY

public static final String getCOLUMN_CLASSES_KEY()

getCOLUMN_ERRORS_KEY

public static final String getCOLUMN_ERRORS_KEY()

getCOLUMN_FILES_KEY

public static final String getCOLUMN_FILES_KEY()

getCOLUMN_MISSINGCLASSES_KEY

public static final 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 ResourceBundle getBundle()

setBundle

public void setBundle(ResourceBundle value)

getLog

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

setLog

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

getThreshold

public String getThreshold()

setThreshold

public void setThreshold(String value)

getEffort

public String getEffort()

setEffort

public void setEffort(String value)

getCurrentClassName

public String getCurrentClassName()

setCurrentClassName

public void setCurrentClassName(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 Set getMissingClassSet()

setMissingClassSet

public void setMissingClassSet(Set value)

getErrorCount

public int getErrorCount()

setErrorCount

public void setErrorCount(int value)

getOutputDirectory

public File getOutputDirectory()

setOutputDirectory

public void setOutputDirectory(File value)

getXrefLocation

public File getXrefLocation()

setXrefLocation

public void setXrefLocation(File value)

getXrefTestLocation

public File getXrefTestLocation()

setXrefTestLocation

public void setXrefTestLocation(File value)

getCompileSourceRoots

public List getCompileSourceRoots()

setCompileSourceRoots

public void setCompileSourceRoots(List value)

getTestSourceRoots

public List getTestSourceRoots()

setTestSourceRoots

public void setTestSourceRoots(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 File getBasedir()

setBasedir

public void setBasedir(File value)

getFindbugsResults

public groovy.util.slurpersupport.GPathResult getFindbugsResults()

setFindbugsResults

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

getBugClasses

public List getBugClasses()

setBugClasses

public void setBugClasses(List value)

printBody

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

printBug

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

Parameters:
bugInstance - the bug to print

assembleJxrHyperlink

protected 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 String getReportTitle()
Gets the report title.

Returns:
The report title.

openClassReportSection

protected void openClassReportSection(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()

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 Object invokeMethod(String name,
                           Object args)
Specified by:
invokeMethod in interface groovy.lang.GroovyObject

getProperty

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

setProperty

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


Copyright © 2005-2012 Codehaus. All Rights Reserved.