Package edu.umd.cs.findbugs
Class XDocsBugReporter
- java.lang.Object
-
- edu.umd.cs.findbugs.AbstractBugReporter
-
- edu.umd.cs.findbugs.TextUIBugReporter
-
- edu.umd.cs.findbugs.XDocsBugReporter
-
- All Implemented Interfaces:
RepositoryLookupFailureCallback
,BugReporter
,IClassObserver
,IErrorLogger
,ConfigurableBugReporter
public class XDocsBugReporter extends TextUIBugReporter
BugReporter to output warnings in xdocs format for Maven.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.umd.cs.findbugs.AbstractBugReporter
AbstractBugReporter.Error
-
-
Field Summary
Fields Modifier and Type Field Description 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
OTHER_CATEGORY_ABBREV, outputStream
-
Fields inherited from interface edu.umd.cs.findbugs.BugReporter
NORMAL, SILENT
-
-
Constructor Summary
Constructors Constructor Description XDocsBugReporter(Project project)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doReportBug(BugInstance bugInstance)
Subclasses must override this.private org.dom4j.Document
endDocument(Project project)
void
finish()
Finish reporting bugs.BugCollection
getBugCollection()
Get the bug collection (if any) associated with this bug reportervoid
logError(java.lang.String message)
Log an error that occurs while performing analysis.void
observeClass(ClassDescriptor classDescriptor)
Observe a class being visited.protected void
printBug(BugInstance bugInstance)
Print bug in one-line format.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
toElement(BugInstance bugInstance)
private void
writeXML(java.io.Writer out, Project project)
private static java.lang.String
xmlEscape(java.lang.String theString)
-
Methods inherited from class edu.umd.cs.findbugs.TextUIBugReporter
checkBugInstance, emitLine, getRealBugReporter, getUseLongBugCodes, isApplySuppressions, reportAnalysisError, reportMissingClass, reportQueuedErrors, setApplySuppressions, setOutputStream, setReportHistory, setReportStackTrace, setShowRank, setUseLongBugCodes, setWriter
-
Methods inherited from class edu.umd.cs.findbugs.AbstractBugReporter
addObserver, getMissingClasses, getMissingClassName, getProjectStats, getQueuedErrors, isRelaxed, isValidMissingClassMessage, logError, notifyObservers, reportBug, reportBugsFromXml, reportSkippedAnalysis, setErrorVerbosity, setIsRelaxed, 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
addObserver, getProjectStats, reportBug, setErrorVerbosity, setPriorityThreshold
-
Methods inherited from interface edu.umd.cs.findbugs.ConfigurableBugReporter
setRankThreshold
-
Methods inherited from interface edu.umd.cs.findbugs.classfile.IErrorLogger
logError, reportSkippedAnalysis
-
-
-
-
Field Detail
-
bugCollection
private final SortedBugCollection bugCollection
-
project
private final Project project
-
document
private final org.dom4j.Document document
-
root
private final 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(ClassDescriptor classDescriptor)
Description copied from interface:IClassObserver
Observe a class being visited.- Parameters:
classDescriptor
- class being visited
-
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 interfaceIErrorLogger
- Overrides:
logError
in classAbstractBugReporter
- 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 interfaceIErrorLogger
- Overrides:
reportMissingClass
in classAbstractBugReporter
- 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 interfaceIErrorLogger
- Overrides:
reportMissingClass
in classAbstractBugReporter
- Parameters:
classDescriptor
- ClassDescriptor of a missing class
-
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 classAbstractBugReporter
- Parameters:
bugInstance
- the bug to report
-
printBug
protected void printBug(BugInstance bugInstance)
Description copied from class:TextUIBugReporter
Print bug in one-line format.- Overrides:
printBug
in classTextUIBugReporter
- Parameters:
bugInstance
- the bug to print
-
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.Writer out, Project project) throws java.io.IOException
- Throws:
java.io.IOException
-
endDocument
private org.dom4j.Document endDocument(Project project)
-
xmlEscape
private static java.lang.String xmlEscape(java.lang.String theString)
-
toElement
public void toElement(BugInstance bugInstance)
-
getBugCollection
@Nonnull public BugCollection getBugCollection()
Description copied from interface:BugReporter
Get the bug collection (if any) associated with this bug reporter
-
-