FindBugs™ 1.3.9

edu.umd.cs.findbugs
Class TextUIBugReporter

java.lang.Object
  extended by edu.umd.cs.findbugs.AbstractBugReporter
      extended by edu.umd.cs.findbugs.TextUIBugReporter
All Implemented Interfaces:
RepositoryLookupFailureCallback, BugReporter, IClassObserver, IErrorLogger
Direct Known Subclasses:
BugCollectionBugReporter, EmacsBugReporter, PrintingBugReporter, SortingBugReporter, SwingGUIBugReporter, XDocsBugReporter

public abstract class TextUIBugReporter
extends AbstractBugReporter

Base class for BugReporters which provides convenient formatting and reporting of warnings and analysis errors.

"TextUIBugReporter" is a bit of a misnomer, since this class is useful in GUIs, too.

Author:
David Hovemeyer

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.umd.cs.findbugs.AbstractBugReporter
AbstractBugReporter.Error
 
Field Summary
protected  java.io.PrintStream outputStream
           
 
Fields inherited from interface edu.umd.cs.findbugs.BugReporter
NORMAL, SILENT
 
Constructor Summary
TextUIBugReporter()
           
 
Method Summary
protected  void checkBugInstance(BugInstance bugInstance)
          For debugging: check a BugInstance to make sure it is valid.
protected  void emitLine(java.lang.String line)
          Emit one line of the error message report.
 BugReporter getRealBugReporter()
          Get the real bug reporter at the end of a chain of delegating bug reporters.
 boolean getUseLongBugCodes()
           
 boolean isApplySuppressions()
           
protected  void printBug(BugInstance bugInstance)
          Print bug in one-line format.
 void reportAnalysisError(AnalysisError error)
          Report a queued error.
 void reportMissingClass(java.lang.String message)
          Report a missing class.
 void reportQueuedErrors()
          Report any accumulated error messages.
 void setApplySuppressions(boolean applySuppressions)
           
 void setOutputStream(java.io.PrintStream outputStream)
          Set the PrintStream to write bug output to.
 void setReportHistory(boolean reportHistory)
           
 void setReportStackTrace(boolean reportStackTrace)
          Set whether or not stack traces should be reported in error output.
 void setReportUserDesignations(boolean reportUserDesignations)
           
 void setShowRank(boolean showRank)
           
 void setUseLongBugCodes(boolean useLongBugCodes)
           
 
Methods inherited from class edu.umd.cs.findbugs.AbstractBugReporter
addObserver, doReportBug, getMissingClasses, getMissingClassName, getProjectStats, getQueuedErrors, isValidMissingClassMessage, logError, logError, notifyObservers, reportBug, reportBugsFromXml, reportMissingClass, reportMissingClass, reportSkippedAnalysis, setErrorVerbosity, setPriorityThreshold, setRankThreshold
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.umd.cs.findbugs.BugReporter
finish
 
Methods inherited from interface edu.umd.cs.findbugs.classfile.IClassObserver
observeClass
 

Field Detail

outputStream

protected java.io.PrintStream outputStream
Constructor Detail

TextUIBugReporter

public TextUIBugReporter()
Method Detail

setOutputStream

public void setOutputStream(@WillClose
                            java.io.PrintStream outputStream)
Set the PrintStream to write bug output to.

Parameters:
outputStream - the PrintStream to write bug output to

setReportStackTrace

public void setReportStackTrace(boolean reportStackTrace)
Set whether or not stack traces should be reported in error output.

Parameters:
reportStackTrace - true if stack traces should be reported, false if not

printBug

protected void printBug(BugInstance bugInstance)
Print bug in one-line format.

Parameters:
bugInstance - the bug to print

reportQueuedErrors

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

Specified by:
reportQueuedErrors in interface BugReporter
Overrides:
reportQueuedErrors in class AbstractBugReporter

reportAnalysisError

public void reportAnalysisError(AnalysisError error)
Description copied from class: AbstractBugReporter
Report a queued error.

Specified by:
reportAnalysisError in class AbstractBugReporter
Parameters:
error - the queued error

reportMissingClass

public void reportMissingClass(java.lang.String message)
Description copied from class: AbstractBugReporter
Report a missing class.

Specified by:
reportMissingClass in class AbstractBugReporter
Parameters:
message - the name of the class

emitLine

protected void emitLine(java.lang.String line)
Emit one line of the error message report. By default, error messages are printed to System.err. Subclasses may override.

Parameters:
line - one line of the error report

getUseLongBugCodes

public boolean getUseLongBugCodes()

setReportHistory

public void setReportHistory(boolean reportHistory)

setUseLongBugCodes

public void setUseLongBugCodes(boolean useLongBugCodes)

setShowRank

public void setShowRank(boolean showRank)

setApplySuppressions

public void setApplySuppressions(boolean applySuppressions)

setReportUserDesignations

public void setReportUserDesignations(boolean reportUserDesignations)

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

Returns:
the real bug reporter at the end of the chain, or this object if there is no delegation

checkBugInstance

protected void checkBugInstance(BugInstance bugInstance)
For debugging: check a BugInstance to make sure it is valid.

Parameters:
bugInstance - the BugInstance to check

isApplySuppressions

public boolean isApplySuppressions()

FindBugs™ 1.3.9

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