org.codehaus.mojo.findbugs
Class XDocsReporter

java.lang.Object
  extended by edu.umd.cs.findbugs.AbstractBugReporter
      extended by edu.umd.cs.findbugs.TextUIBugReporter
          extended by org.codehaus.mojo.findbugs.XDocsReporter
All Implemented Interfaces:
edu.umd.cs.findbugs.ba.RepositoryLookupFailureCallback, edu.umd.cs.findbugs.BugReporter, edu.umd.cs.findbugs.classfile.IClassObserver, edu.umd.cs.findbugs.classfile.IErrorLogger

public class XDocsReporter
extends edu.umd.cs.findbugs.TextUIBugReporter

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: XDocsReporter.groovy 6588 2008-03-28 12:22:57Z bentmann $
Author:
Garvin LeClaire

Field Summary
 
Fields inherited from class edu.umd.cs.findbugs.TextUIBugReporter
outputStream
 
Fields inherited from interface edu.umd.cs.findbugs.BugReporter
NORMAL, SILENT
 
Constructor Summary
XDocsReporter(org.apache.maven.project.MavenProject mavenProject)
          Default constructor.
 
Method Summary
protected  void closeClassReportSection()
          Closes the class report section.
protected  void doReportBug(edu.umd.cs.findbugs.BugInstance bugInstance)
           
protected  java.lang.String evaluateThresholdParameter(int thresholdValue)
          Returns the threshold string value for the integer input.
 void finish()
           
 edu.umd.cs.findbugs.SortedBugCollection getBugCollection()
           
 int getBugCount()
           
 java.lang.String getCurrentClassName()
           
 EffortParameter getEffort()
           
 int getFileCount()
           
protected  java.lang.String getFindBugsVersion()
          Gets the Findbugs Version of the report.
 boolean getIsCurrentClassReportOpened()
           
 org.apache.maven.plugin.logging.Log getLog()
           
 org.apache.maven.project.MavenProject getMavenProject()
           
 groovy.lang.MetaClass getMetaClass()
           
 int getMissingClassCount()
           
static java.lang.String getNOLINE_KEY()
           
 java.io.Writer getOutputWriter()
           
 java.lang.Object getProperty(java.lang.String name)
           
 java.util.ResourceBundle getResourceBundle()
           
 FindbugsXdocSink getSink()
           
 ThresholdParameter getThreshold()
           
 java.lang.Object invokeMethod(java.lang.String name, java.lang.Object args)
           
 boolean isIsCurrentClassReportOpened()
           
 void logError(java.lang.String message)
           
 void logError(java.lang.String message, java.lang.Throwable e)
           
 void observeClass(edu.umd.cs.findbugs.classfile.ClassDescriptor classDescriptor)
          Observe a class.
protected  void printBug(edu.umd.cs.findbugs.BugInstance bugInstance)
          Print the bug collection to a line in the table
protected  void printErrors()
          Closes the class report section.
protected  void printSource()
          Output Source Directories.
 void reportMissingClass(edu.umd.cs.findbugs.classfile.ClassDescriptor classDescriptor)
           
 void reportMissingClass(java.lang.ClassNotFoundException ex)
           
 void setBugCollection(edu.umd.cs.findbugs.SortedBugCollection value)
           
 void setBugCount(int value)
           
 void setCurrentClassName(java.lang.String value)
           
 void setEffort(EffortParameter value)
           
 void setFileCount(int value)
           
 void setIsCurrentClassReportOpened(boolean value)
           
 void setLog(org.apache.maven.plugin.logging.Log value)
           
 void setMavenProject(org.apache.maven.project.MavenProject value)
           
 void setMetaClass(groovy.lang.MetaClass metaClass)
           
 void setMissingClassCount(int value)
           
 void setOutputWriter(java.io.Writer value)
           
 void setProperty(java.lang.String name, java.lang.Object value)
           
 void setResourceBundle(java.util.ResourceBundle resourceBundle)
           
 void setSink(FindbugsXdocSink value)
           
 void setThreshold(ThresholdParameter value)
           
protected  java.lang.String valueForLine(edu.umd.cs.findbugs.SourceLineAnnotation line)
          Return the value to display.
 
Methods inherited from class edu.umd.cs.findbugs.TextUIBugReporter
checkBugInstance, emitLine, getRealBugReporter, getUseLongBugCodes, reportAnalysisError, reportMissingClass, reportQueuedErrors, setOutputStream, setReportHistory, setReportStackTrace, setReportUserDesignations, setUseLongBugCodes
 
Methods inherited from class edu.umd.cs.findbugs.AbstractBugReporter
addObserver, getMissingClassName, getProjectStats, notifyObservers, reportBug, reportBugsFromXml, reportSkippedAnalysis, setErrorVerbosity, setPriorityThreshold
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XDocsReporter

public XDocsReporter(org.apache.maven.project.MavenProject mavenProject)
Default constructor.

Parameters:
realBugReporter - the BugReporter to Delegate
Method Detail

getNOLINE_KEY

public static final java.lang.String getNOLINE_KEY()

setSink

public void setSink(FindbugsXdocSink value)

getResourceBundle

public java.util.ResourceBundle getResourceBundle()

getLog

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

setLog

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

getThreshold

public ThresholdParameter getThreshold()

setThreshold

public void setThreshold(ThresholdParameter value)

getEffort

public EffortParameter getEffort()

setEffort

public void setEffort(EffortParameter value)

getCurrentClassName

public java.lang.String getCurrentClassName()

setCurrentClassName

public void setCurrentClassName(java.lang.String value)

getIsCurrentClassReportOpened

public boolean getIsCurrentClassReportOpened()

isIsCurrentClassReportOpened

public boolean isIsCurrentClassReportOpened()

setIsCurrentClassReportOpened

public void setIsCurrentClassReportOpened(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)

getBugCollection

public edu.umd.cs.findbugs.SortedBugCollection getBugCollection()

setBugCollection

public void setBugCollection(edu.umd.cs.findbugs.SortedBugCollection value)

getOutputWriter

public java.io.Writer getOutputWriter()

setOutputWriter

public void setOutputWriter(java.io.Writer value)

getMavenProject

public org.apache.maven.project.MavenProject getMavenProject()

setMavenProject

public void setMavenProject(org.apache.maven.project.MavenProject value)

finish

public void finish()
See Also:
BugReporter.finish()

getSink

public FindbugsXdocSink getSink()
Returns:
the sink

logError

public void logError(java.lang.String message)
Specified by:
logError in interface edu.umd.cs.findbugs.classfile.IErrorLogger
Overrides:
logError in class edu.umd.cs.findbugs.AbstractBugReporter

logError

public void logError(java.lang.String message,
                     java.lang.Throwable e)
Specified by:
logError in interface edu.umd.cs.findbugs.classfile.IErrorLogger
Overrides:
logError in class edu.umd.cs.findbugs.AbstractBugReporter

observeClass

public void observeClass(edu.umd.cs.findbugs.classfile.ClassDescriptor classDescriptor)
Observe a class.

Parameters:
classDescriptor - The Class to Observe
See Also:
#observeClass(edu.umd.cs.findbugs.classfile.ClassDescriptor)

reportMissingClass

public void reportMissingClass(edu.umd.cs.findbugs.classfile.ClassDescriptor classDescriptor)
Specified by:
reportMissingClass in interface edu.umd.cs.findbugs.classfile.IErrorLogger
Overrides:
reportMissingClass in class edu.umd.cs.findbugs.AbstractBugReporter

reportMissingClass

public void reportMissingClass(java.lang.ClassNotFoundException ex)
Specified by:
reportMissingClass in interface edu.umd.cs.findbugs.classfile.IErrorLogger
Overrides:
reportMissingClass in class edu.umd.cs.findbugs.AbstractBugReporter

setResourceBundle

public void setResourceBundle(java.util.ResourceBundle resourceBundle)
Parameters:
resourceBundle - the resourceBundle to set

printBug

protected void printBug(edu.umd.cs.findbugs.BugInstance bugInstance)
Print the bug collection to a line in the table

Overrides:
printBug in class edu.umd.cs.findbugs.TextUIBugReporter
Parameters:
bugInstance - the bug to print

closeClassReportSection

protected void closeClassReportSection()
Closes the class report section.


evaluateThresholdParameter

protected java.lang.String evaluateThresholdParameter(int thresholdValue)
Returns the threshold string value for the integer input.

Parameters:
thresholdValue - The ThresholdValue integer to evaluate.
Returns:
The string valueof the Threshold object.

getFindBugsVersion

protected java.lang.String getFindBugsVersion()
Gets the Findbugs Version of the report.

Returns:
The Findbugs Version used on the report.

printErrors

protected void printErrors()
Closes the class report section.


printSource

protected void printSource()
Output Source Directories.


valueForLine

protected java.lang.String valueForLine(edu.umd.cs.findbugs.SourceLineAnnotation 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.

doReportBug

protected void doReportBug(edu.umd.cs.findbugs.BugInstance bugInstance)
Specified by:
doReportBug in class edu.umd.cs.findbugs.AbstractBugReporter
Parameters:
bugInstance - The bug to report
See Also:
#doReportBug(edu.umd.cs.findbugs.BugInstance)

getMetaClass

public groovy.lang.MetaClass getMetaClass()

setMetaClass

public void setMetaClass(groovy.lang.MetaClass metaClass)

invokeMethod

public java.lang.Object invokeMethod(java.lang.String name,
                                     java.lang.Object args)

getProperty

public java.lang.Object getProperty(java.lang.String name)

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)


Copyright © 2005-2009. All Rights Reserved.