|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.are.report.ProblemContext
public class ProblemContext
The ProblemContext
class encapsulates the context of a reported problem.
The purpose of this class is to provide plugins with a way to report additional details
about a problem that is reported using the reportError
,
reportWarning
, or reportInfo
methods.
Here is an example of making use of the ProblemContext
to report a few
details for a reported problem:
ProblemContext probCtx = reportError("A problem has been found"); probCtx.details("Here is more information about the problem"); probCtx.details("And here is even more information about the problem");
So why use this problem context object? Why not just report the details using the
same method that was used to report the problem itself? The answer lies in how ARE
counts the number of problems found by a plugin. Each time a problem is reported,
the count of the number of problems is incremented. But any details associated with
a problem are not counted. So in the example code above, the reportError
would cause the problem count to go up by one, but the two subsequent details for that
problem do not have any affect on the problem count. If we had simply used
reportError
three times; once to report the problem and twice more to report
its details, the resulting problem count would have been (incorrectly) incremented three
times instead of just once.
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT
Copyright for class bytecode |
Constructor Summary | |
---|---|
ProblemContext(BasePlugin.ReporterCollection reporter,
java.lang.String errorLevel)
Constructs a ProblemContext object |
Method Summary | |
---|---|
ProblemContext |
details(java.lang.String msg)
Reports details for the reported problem represented by this problem context |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
Constructor Detail |
---|
public ProblemContext(BasePlugin.ReporterCollection reporter, java.lang.String errorLevel)
ProblemContext
object
reporter
- The collection of reporters used to report problems for a pluginerrorLevel
- The severity level for the reported problemMethod Detail |
---|
public ProblemContext details(java.lang.String msg)
msg
- The detailed message to report
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |