org.codehaus.mojo.findbugs
Class XDocsReporter

java.lang.Object
  extended by edu.umd.cs.findbugs.DelegatingBugReporter
      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 final class XDocsReporter
extends edu.umd.cs.findbugs.DelegatingBugReporter

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.java 2561 2006-10-24 21:06:39Z gleclaire $
Author:
Garvin LeClaire

Field Summary
 
Fields inherited from interface edu.umd.cs.findbugs.BugReporter
NORMAL, SILENT
 
Constructor Summary
XDocsReporter(edu.umd.cs.findbugs.BugReporter realBugReporter)
          Default constructor.
 
Method Summary
protected  void addBugReport(edu.umd.cs.findbugs.BugInstance bugInstance)
           
protected  void closeClassReportSection()
          Closes the class report section.
protected  String evaluateThresholdParameter(int thresholdValue)
          Returns the threshold string value for the integer input.
 void finish()
           
 EffortParameter getEffort()
           
protected  String getFindBugsVersion()
          Gets the Findbugs Version of the report.
 org.apache.maven.plugin.logging.Log getLog()
           
 Writer getOutputWriter()
           
 ResourceBundle getResourceBundle()
           
 FindbugsXdocSink getSink()
           
 ThresholdParameter getThreshold()
           
 void logError(String message)
           
 void logError(String message, Throwable e)
           
 void observeClass(edu.umd.cs.findbugs.classfile.ClassDescriptor classDescriptor)
          Observe a class.
protected  void printErrors()
          Closes the class report section.
 void reportMissingClass(edu.umd.cs.findbugs.classfile.ClassDescriptor classDescriptor)
           
 void reportMissingClass(ClassNotFoundException ex)
           
 void setEffort(EffortParameter effort)
           
 void setLog(org.apache.maven.plugin.logging.Log log)
           
 void setOutputWriter(Writer outputWriter)
           
 void setResourceBundle(ResourceBundle resourceBundle)
           
 void setThreshold(ThresholdParameter threshold)
           
protected  String valueForLine(edu.umd.cs.findbugs.SourceLineAnnotation pLine)
          Return the value to display.
 
Methods inherited from class edu.umd.cs.findbugs.DelegatingBugReporter
addObserver, getDelegate, getProjectStats, getRealBugReporter, reportBug, reportQueuedErrors, reportSkippedAnalysis, setDelegate, 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(edu.umd.cs.findbugs.BugReporter realBugReporter)
Default constructor.

Parameters:
realBugReporter - the BugReporter to Delegate
Method Detail

finish

public void finish()
Specified by:
finish in interface edu.umd.cs.findbugs.BugReporter
Overrides:
finish in class edu.umd.cs.findbugs.DelegatingBugReporter
See Also:
BugReporter.finish()

getEffort

public EffortParameter getEffort()
Returns:
the effort

getLog

public org.apache.maven.plugin.logging.Log getLog()
Returns:
the log

getOutputWriter

public Writer getOutputWriter()
Returns:
the outputWriter

getResourceBundle

public ResourceBundle getResourceBundle()
Returns:
the resourceBundle

getSink

public FindbugsXdocSink getSink()
Returns:
the sink

getThreshold

public ThresholdParameter getThreshold()
Returns:
the threshold

logError

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

logError

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

observeClass

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

Specified by:
observeClass in interface edu.umd.cs.findbugs.classfile.IClassObserver
Overrides:
observeClass in class edu.umd.cs.findbugs.DelegatingBugReporter
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.DelegatingBugReporter

reportMissingClass

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

setEffort

public void setEffort(EffortParameter effort)
Parameters:
effort - the effort to set

setLog

public void setLog(org.apache.maven.plugin.logging.Log log)
Parameters:
log - the log to set

setOutputWriter

public void setOutputWriter(Writer outputWriter)
Parameters:
outputWriter - the outputWriter to set

setResourceBundle

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

setThreshold

public void setThreshold(ThresholdParameter threshold)
Parameters:
threshold - the threshold to set

addBugReport

protected void addBugReport(edu.umd.cs.findbugs.BugInstance bugInstance)

closeClassReportSection

protected void closeClassReportSection()
Closes the class report section.


evaluateThresholdParameter

protected 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 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.


valueForLine

protected String valueForLine(edu.umd.cs.findbugs.SourceLineAnnotation pLine)
Return the value to display. If FindBugs does not provide a line number, a default message is returned. The line number otherwise.

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


Copyright © 2005-2006 CodeHaus. All Rights Reserved.