FindBugs™ 1.3.9

edu.umd.cs.findbugs
Class DelegatingBugReporter

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

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
 
Fields inherited from interface edu.umd.cs.findbugs.BugReporter
NORMAL, SILENT
 
Constructor Summary
DelegatingBugReporter(BugReporter delegate)
          Constructor.
 
Method Summary
 void addObserver(BugReporterObserver observer)
          Add an observer.
 void finish()
          Finish reporting bugs.
 BugReporter getDelegate()
           
 ProjectStats getProjectStats()
          Get ProjectStats object used to store statistics about the overall project being analyzed.
 BugReporter getRealBugReporter()
          Get the real bug reporter at the end of a chain of delegating bug reporters.
 void logError(java.lang.String message)
          Log an error that occurs while performing analysis.
 void logError(java.lang.String message, java.lang.Throwable e)
          Log an error that occurs while performing analysis.
 void observeClass(ClassDescriptor classDescriptor)
          Observe a class being visited.
 void reportBug(BugInstance bugInstance)
          Report a bug.
 void reportMissingClass(ClassDescriptor classDescriptor)
          Called to report a class lookup failure.
 void reportMissingClass(java.lang.ClassNotFoundException ex)
          Called to report a class lookup failure.
 void reportQueuedErrors()
          Report any accumulated error messages.
 void reportSkippedAnalysis(MethodDescriptor method)
          Report that we skipped some analysis of a method
 void setDelegate(BugReporter delegate)
          Set BugReporter to delegate reported BugInstances to.
 void setErrorVerbosity(int level)
          Set the error-reporting verbosity level.
 void setPriorityThreshold(int threshold)
          Set the priority threshold.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatingBugReporter

public DelegatingBugReporter(BugReporter delegate)
Constructor.

Parameters:
delegate - another BugReporter to delegate all BugReporter methods to
Method Detail

getRealBugReporter

public BugReporter getRealBugReporter()
Description copied from interface: BugReporter
Get the real bug reporter at the end of a chain of delegating bug reporters. All non-delegating bug reporters should simply "return this".

Specified by:
getRealBugReporter in interface BugReporter
Returns:
the real bug reporter at the end of the chain, or this object if there is no delegation

setDelegate

public void setDelegate(BugReporter delegate)
Set BugReporter to delegate reported BugInstances to.

Parameters:
delegate - BugReporter to delegate all BugReporter methods to

getDelegate

public BugReporter getDelegate()

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(ClassDescriptor classDescriptor)
Description copied from interface: IClassObserver
Observe a class being visited.

Specified by:
observeClass in interface IClassObserver
Parameters:
classDescriptor - class being visited

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: IErrorLogger
Log an error that occurs while performing analysis.

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

reportMissingClass

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

Specified by:
reportMissingClass in interface IErrorLogger
Parameters:
ex - a ClassNotFoundException resulting from the class lookup failure

reportMissingClass

public void reportMissingClass(ClassDescriptor classDescriptor)
Description copied from interface: IErrorLogger
Called to report a class lookup failure.

Specified by:
reportMissingClass in interface IErrorLogger
Parameters:
classDescriptor - ClassDescriptor of a missing class

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

logError

public void logError(java.lang.String message,
                     java.lang.Throwable e)
Description copied from interface: IErrorLogger
Log an error that occurs while performing analysis.

Specified by:
logError in interface IErrorLogger
Parameters:
message - the error message
e - the exception which is the underlying cause of the error

reportSkippedAnalysis

public void reportSkippedAnalysis(MethodDescriptor method)
Report that we skipped some analysis of a method

Specified by:
reportSkippedAnalysis in interface IErrorLogger
Parameters:
method -

FindBugs™ 1.3.9

FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.