com.ibm.are.report
Class ProblemContext

java.lang.Object
  extended by com.ibm.are.report.ProblemContext

public class ProblemContext
extends java.lang.Object

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.

Version:
1.0
Author:
IBM

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

COPYRIGHT

public static final java.lang.String COPYRIGHT
Copyright for class bytecode

See Also:
Constant Field Values
Constructor Detail

ProblemContext

public ProblemContext(BasePlugin.ReporterCollection reporter,
                      java.lang.String errorLevel)
Constructs a ProblemContext object

Parameters:
reporter - The collection of reporters used to report problems for a plugin
errorLevel - The severity level for the reported problem
Method Detail

details

public ProblemContext details(java.lang.String msg)
Reports details for the reported problem represented by this problem context

Parameters:
msg - The detailed message to report
Returns:
A reference to this same problem context