KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > umd > cs > findbugs > BugReporter


1 /*
2  * FindBugs - Find bugs in Java programs
3  * Copyright (C) 2003,2004 University of Maryland
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */

19
20 package edu.umd.cs.findbugs;
21
22 import edu.umd.cs.findbugs.ba.RepositoryLookupFailureCallback;
23 import edu.umd.cs.findbugs.classfile.IClassObserver;
24 import edu.umd.cs.findbugs.annotations.NonNull;
25
26 /**
27  * Generic interface for bug reporter objects.
28  * A BugReporter accumulates all of the information reported
29  * by the analyses, which includes bug reports, and also auxiliary
30  * information such as analysis errors, missing classes,
31  * and class to source file mapping.
32  *
33  * @author David Hovemeyer
34  */

35 public interface BugReporter extends RepositoryLookupFailureCallback, IClassObserver {
36
37     /**
38      * Silent error-reporting verbosity level.
39      */

40     public static final int SILENT = 0;
41
42     /**
43      * Normal error-reporting verbosity level.
44      */

45     public static final int NORMAL = 1;
46
47     /**
48      * Set the error-reporting verbosity level.
49      *
50      * @param level the verbosity level
51      */

52     public void setErrorVerbosity(int level);
53
54     /**
55      * Set the priority threshold.
56      *
57      * @param threshold bug instances must be at least as important as
58      * this priority to be reported
59      */

60     public void setPriorityThreshold(int threshold);
61
62     /**
63      * Report a bug.
64      * The implementation may report the bug immediately,
65      * or queue it for later.
66      *
67      * @param bugInstance object describing the bug instance
68      */

69     public void reportBug(@NonNull BugInstance bugInstance);
70
71     /**
72      * Finish reporting bugs.
73      * If any bug reports have been queued, calling this method
74      * will flush them.
75      */

76     public void finish();
77
78     /**
79      * Report any accumulated error messages.
80      */

81     public void reportQueuedErrors();
82
83     /**
84      * Add an observer.
85      *
86      * @param observer the observer
87      */

88     public void addObserver(BugReporterObserver observer);
89
90     /**
91      * Get ProjectStats object used to store statistics about
92      * the overall project being analyzed.
93      */

94     public ProjectStats getProjectStats();
95     
96     /**
97      * Get the real bug reporter at the end of a chain of delegating bug reporters.
98      * All non-delegating bug reporters should simply "return this".
99      *
100      * @return the real bug reporter at the end of the chain, or
101      * this object if there is no delegation
102      */

103     public BugReporter getRealBugReporter();
104 }
105
106 // vim:ts=4
107
Popular Tags