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.StringANALYSIS_ERROR_ELEMENT_NAMEprivate SortedBugCollectionbugCollectionprivate org.dom4j.Documentdocumentprivate static java.lang.StringELEMENT_NAMEprivate static java.lang.StringERRORS_ELEMENT_NAMEprivate static java.lang.StringFILE_ELEMENT_NAMEprivate static java.lang.StringMISSING_CLASS_ELEMENT_NAMEprivate Projectprojectprivate org.dom4j.Elementrootprivate static java.lang.StringROOT_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 voiddoReportBug(BugInstance bugInstance)Subclasses must override this.private org.dom4j.DocumentendDocument(Project project)voidfinish()Finish reporting bugs.BugCollectiongetBugCollection()Get the bug collection (if any) associated with this bug reportervoidlogError(java.lang.String message)Log an error that occurs while performing analysis.voidobserveClass(ClassDescriptor classDescriptor)Observe a class being visited.protected voidprintBug(BugInstance bugInstance)Print bug in one-line format.voidreportMissingClass(ClassDescriptor classDescriptor)Called to report a class lookup failure.voidreportMissingClass(java.lang.ClassNotFoundException ex)Called to report a class lookup failure.voidtoElement(BugInstance bugInstance)private voidwriteXML(java.io.Writer out, Project project)private static java.lang.StringxmlEscape(java.lang.String theString)-
Methods inherited from class edu.umd.cs.findbugs.TextUIBugReporter
checkBugInstance, emitLine, getOutputTarget, getRealBugReporter, getUseLongBugCodes, isApplySuppressions, isDuplicateOf, reportAnalysisError, reportMissingClass, reportQueuedErrors, setApplySuppressions, setOutputStream, setOutputTarget, setReportHistory, setReportStackTrace, setShowRank, setUseLongBugCodes, setWriter
-
Methods inherited from class edu.umd.cs.findbugs.AbstractBugReporter
addObserver, getMissingClasses, getMissingClassName, getPriorityAdjuster, getProjectStats, getQueuedErrors, isRelaxed, isValidMissingClassMessage, logError, notifyObservers, reportBug, reportBugsFromXml, reportSkippedAnalysis, setErrorVerbosity, setIsRelaxed, setPriorityAdjuster, 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, getPriorityAdjuster, getProjectStats, reportBug, setErrorVerbosity, setPriorityAdjuster, setPriorityThreshold
-
Methods inherited from interface edu.umd.cs.findbugs.ConfigurableBugReporter
setRankThreshold
-
Methods inherited from interface edu.umd.cs.findbugs.classfile.IErrorLogger
logError, reportMissingClass, 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
-
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
-
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:IClassObserverObserve a class being visited.- Parameters:
classDescriptor- class being visited
-
logError
public void logError(java.lang.String message)
Description copied from interface:IErrorLoggerLog an error that occurs while performing analysis.- Specified by:
logErrorin interfaceIErrorLogger- Overrides:
logErrorin classAbstractBugReporter- Parameters:
message- the error message
-
reportMissingClass
public void reportMissingClass(java.lang.ClassNotFoundException ex)
Description copied from interface:IErrorLoggerCalled to report a class lookup failure.- Specified by:
reportMissingClassin interfaceIErrorLogger- Overrides:
reportMissingClassin classAbstractBugReporter- Parameters:
ex- a ClassNotFoundException resulting from the class lookup failure
-
reportMissingClass
public void reportMissingClass(ClassDescriptor classDescriptor)
Description copied from interface:IErrorLoggerCalled to report a class lookup failure.- Specified by:
reportMissingClassin interfaceIErrorLogger- Overrides:
reportMissingClassin classAbstractBugReporter- Parameters:
classDescriptor- ClassDescriptor of a missing class
-
doReportBug
public void doReportBug(BugInstance bugInstance)
Description copied from class:AbstractBugReporterSubclasses must override this. It will be called only for bugs which meet the priority threshold.- Specified by:
doReportBugin classAbstractBugReporter- Parameters:
bugInstance- the bug to report
-
printBug
protected void printBug(BugInstance bugInstance)
Description copied from class:TextUIBugReporterPrint bug in one-line format.- Overrides:
printBugin classTextUIBugReporter- Parameters:
bugInstance- the bug to print
-
finish
public void finish()
Description copied from interface:BugReporterFinish 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:BugReporterGet the bug collection (if any) associated with this bug reporter
-
-