edu.umd.cs.findbugs
Class XDocsBugReporter

java.lang.Object
  extended by edu.umd.cs.findbugs.AbstractBugReporter
      extended by edu.umd.cs.findbugs.TextUIBugReporter
          extended by edu.umd.cs.findbugs.XDocsBugReporter
All Implemented Interfaces:
ClassObserver, RepositoryLookupFailureCallback, BugReporter

public class XDocsBugReporter
extends TextUIBugReporter

BugReporter to output warnings in xdocs format for Maven.

Author:
Garvin LeClaire

Field Summary
private static java.lang.String ANALYSIS_ERROR_ELEMENT_NAME
           
private  SortedBugCollection bugCollection
           
private  org.dom4j.Document document
           
private static java.lang.String ELEMENT_NAME
           
private static java.lang.String ERRORS_ELEMENT_NAME
           
private static java.lang.String FILE_ELEMENT_NAME
           
private static java.lang.String MISSING_CLASS_ELEMENT_NAME
           
private  Project project
           
private static java.lang.String PROJECT_ELEMENT_NAME
           
private  org.dom4j.Element root
           
private static java.lang.String ROOT_ELEMENT_NAME
           
private static java.lang.String SUMMARY_HTML_ELEMENT_NAME
           
 
Fields inherited from class edu.umd.cs.findbugs.TextUIBugReporter
outputStream
 
Fields inherited from interface edu.umd.cs.findbugs.BugReporter
NORMAL, SILENT
 
Constructor Summary
XDocsBugReporter(Project project)
           
 
Method Summary
 void doReportBug(BugInstance bugInstance)
          Subclasses must override this.
private  org.dom4j.Document endDocument(Project project)
           
 void finish()
          Finish reporting bugs.
 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.
protected  void printBug(BugInstance bugInstance)
           
 void reportMissingClass(java.lang.ClassNotFoundException ex)
          Called to report a lookup failure.
 void toElement(BugInstance bugInstance)
           
private  void writeXML(java.io.OutputStream out, Project project)
           
 
Methods inherited from class edu.umd.cs.findbugs.TextUIBugReporter
beginReport, endReport, reportLine, setOutputStream
 
Methods inherited from class edu.umd.cs.findbugs.AbstractBugReporter
addObserver, getEngine, getMissingClassName, getProjectStats, notifyObservers, reportBug, reportQueuedErrors, setEngine, setErrorVerbosity, setPriorityThreshold
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bugCollection

private SortedBugCollection bugCollection

project

private Project project

document

private org.dom4j.Document document

root

private org.dom4j.Element root

ROOT_ELEMENT_NAME

private static final java.lang.String ROOT_ELEMENT_NAME
See Also:
Constant Field Values

PROJECT_ELEMENT_NAME

private static final java.lang.String PROJECT_ELEMENT_NAME
See Also:
Constant Field Values

ERRORS_ELEMENT_NAME

private static final java.lang.String ERRORS_ELEMENT_NAME
See Also:
Constant Field Values

ANALYSIS_ERROR_ELEMENT_NAME

private static final java.lang.String ANALYSIS_ERROR_ELEMENT_NAME
See Also:
Constant Field Values

MISSING_CLASS_ELEMENT_NAME

private static final java.lang.String MISSING_CLASS_ELEMENT_NAME
See Also:
Constant Field Values

SUMMARY_HTML_ELEMENT_NAME

private static final java.lang.String SUMMARY_HTML_ELEMENT_NAME
See Also:
Constant Field Values

ELEMENT_NAME

private static final java.lang.String ELEMENT_NAME
See Also:
Constant Field Values

FILE_ELEMENT_NAME

private static final java.lang.String FILE_ELEMENT_NAME
See Also:
Constant Field Values
Constructor Detail

XDocsBugReporter

public XDocsBugReporter(Project project)
Method Detail

observeClass

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

Parameters:
javaClass - the class

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
Overrides:
logError in class AbstractBugReporter
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
Overrides:
reportMissingClass in class AbstractBugReporter
Parameters:
ex - a ClassNotFoundException resulting from the failure

doReportBug

public void doReportBug(BugInstance bugInstance)
Description copied from class: AbstractBugReporter
Subclasses must override this. It will be called only for bugs which meet the priority threshold.

Specified by:
doReportBug in class AbstractBugReporter

printBug

protected void printBug(BugInstance bugInstance)
Overrides:
printBug in class TextUIBugReporter

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.


writeXML

private void writeXML(java.io.OutputStream out,
                      Project project)
               throws java.io.IOException
Throws:
java.io.IOException

endDocument

private org.dom4j.Document endDocument(Project project)

toElement

public void toElement(BugInstance bugInstance)