edu.umd.cs.findbugs
Class DelegatingBugReporter

java.lang.Object
  extended by edu.umd.cs.findbugs.DelegatingBugReporter
All Implemented Interfaces:
ClassObserver, RepositoryLookupFailureCallback, BugReporter
Direct Known Subclasses:
FilterBugReporter, FindBugs.CategoryFilteringBugReporter, FindBugs.ErrorCountingBugReporter

public class DelegatingBugReporter
extends java.lang.Object
implements BugReporter

A BugReporter which delegates all method calls to another BugReporter. This is useful for customizing the behavior of another bug reporter.

Author:
David Hovemeyer

Field Summary
private  BugReporter realBugReporter
           
 
Fields inherited from interface edu.umd.cs.findbugs.BugReporter
NORMAL, SILENT
 
Constructor Summary
DelegatingBugReporter(BugReporter realBugReporter)
           
 
Method Summary
 void addObserver(BugReporterObserver observer)
          Add an observer.
 void finish()
          Finish reporting bugs.
 ProjectStats getProjectStats()
          Get ProjectStats object used to store statistics about the overall project being analyzed.
 BugReporter getRealBugReporter()
           
 void logError(java.lang.String message)
          Log an error that occurs while looking for bugs.
 void observeClass(org.apache.bcel.classfile.JavaClass javaClass)
          Observe a class.
 void reportBug(BugInstance bugInstance)
          Report a bug.
 void reportMissingClass(java.lang.ClassNotFoundException ex)
          Called to report a lookup failure.
 void reportQueuedErrors()
          Report any accumulated error messages.
 void setEngine(FindBugs engine)
          Called to give the BugReporter a reference to the FindBugs engine object.
 void setErrorVerbosity(int level)
          Set the error-reporting verbosity level.
 void setPriorityThreshold(int threshold)
          Set the priority threshold.
 void setRealBugReporter(BugReporter realBugReporter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

realBugReporter

private BugReporter realBugReporter
Constructor Detail

DelegatingBugReporter

public DelegatingBugReporter(BugReporter realBugReporter)
Method Detail

getRealBugReporter

public BugReporter getRealBugReporter()

setRealBugReporter

public void setRealBugReporter(BugReporter realBugReporter)

setEngine

public void setEngine(FindBugs engine)
Description copied from interface: BugReporter
Called to give the BugReporter a reference to the FindBugs engine object.

Specified by:
setEngine in interface BugReporter
Parameters:
engine - the FindBugs engine object

setErrorVerbosity

public void setErrorVerbosity(int level)
Description copied from interface: BugReporter
Set the error-reporting verbosity level.

Specified by:
setErrorVerbosity in interface BugReporter
Parameters:
level - the verbosity level

setPriorityThreshold

public void setPriorityThreshold(int threshold)
Description copied from interface: BugReporter
Set the priority threshold.

Specified by:
setPriorityThreshold in interface BugReporter
Parameters:
threshold - bug instances must be at least as important as this priority to be reported

observeClass

public void observeClass(org.apache.bcel.classfile.JavaClass javaClass)
Description copied from interface: ClassObserver
Observe a class.

Specified by:
observeClass in interface ClassObserver
Parameters:
javaClass - the class

reportBug

public void reportBug(BugInstance bugInstance)
Description copied from interface: BugReporter
Report a bug. The implementation may report the bug immediately, or queue it for later.

Specified by:
reportBug in interface BugReporter
Parameters:
bugInstance - object describing the bug instance

logError

public void logError(java.lang.String message)
Description copied from interface: BugReporter
Log an error that occurs while looking for bugs.

Specified by:
logError in interface BugReporter
Parameters:
message - the error message

reportMissingClass

public void reportMissingClass(java.lang.ClassNotFoundException ex)
Description copied from interface: RepositoryLookupFailureCallback
Called to report a lookup failure.

Specified by:
reportMissingClass in interface RepositoryLookupFailureCallback
Parameters:
ex - a ClassNotFoundException resulting from the failure

finish

public void finish()
Description copied from interface: BugReporter
Finish reporting bugs. If any bug reports have been queued, calling this method will flush them.

Specified by:
finish in interface BugReporter

reportQueuedErrors

public void reportQueuedErrors()
Description copied from interface: BugReporter
Report any accumulated error messages.

Specified by:
reportQueuedErrors in interface BugReporter

addObserver

public void addObserver(BugReporterObserver observer)
Description copied from interface: BugReporter
Add an observer.

Specified by:
addObserver in interface BugReporter
Parameters:
observer - the observer

getProjectStats

public ProjectStats getProjectStats()
Description copied from interface: BugReporter
Get ProjectStats object used to store statistics about the overall project being analyzed.

Specified by:
getProjectStats in interface BugReporter