org.eclipse.actf.validation.reports
Class ValidationReporter

java.lang.Object
  extended by org.eclipse.actf.util.logging.AbstractReporter
      extended by org.eclipse.actf.validation.reports.ValidationReporter
All Implemented Interfaces:
IReporter

public class ValidationReporter
extends AbstractReporter

used to store logged records for later retrieval. Records can be retreaved all at once or individually, sorted, and organized for a more readable report. This is also the class that should be used when using List-like GUI components for viewing reports.

Author:
Mike Squillace

Field Summary
 
Fields inherited from class org.eclipse.actf.util.logging.AbstractReporter
bundle, categories, CATEGORY_FORMATTER, categoryFormatter, defaultOutputLevel, errorLoggers, SOURCE_ID_MAP, sourceID
 
Fields inherited from interface org.eclipse.actf.util.logging.IReporter
CONFIG, CONFIGURATION, DEFAULT_LEVEL, DETAIL, ERROR, INFO, KEYS, MAX_LEVEL, MIN_LEVEL, SEVERE, SYSTEM_FATAL, SYSTEM_NONFATAL, TRACE, UNKNOWN, USER, VALIDATION, WARNING
 
Constructor Summary
ValidationReporter()
          create a new ValidationReporter
 
Method Summary
 void addReportRecord(ValidationReportRecord record)
          
 void addReportRecords(List records)
          
 void close()
          close processing
 void endReport()
          ends a report started with startReport.
 void flush()
          Flush any pending output
 int getDefaultOutputLevel()
          get the default output level.
 String getLastReport()
          get the last reported message
 int getRecordCount()
          get the number of report records logged by this reporter
 ValidationReportRecord[] getRecords()
          return all records logged by this reporter thus far
 boolean isOpen()
          returns whether or not this reporter is open
 ValidationReportRecord[] lastReport()
           
 void open()
          Open for processing
 void report(int level, String message, Object[] values)
          report the message at the given level with the given substitution values
 void report(int level, String msg, Throwable t)
          reports an exception or error. This method can be used to direct the stack trace of the given throwable to the appropriate output for this reporter (e.g. a GUI text area or stream). The level of the throwable is determined by the specified level parameter.
 void reset()
          reset the reporter. This method should clear all categories and all remaining buffers and report records.
 void setLastReport(String reportText)
          set the last report on this reporter.
 void startReport(Object comp)
          start a new report.
 
Methods inherited from class org.eclipse.actf.util.logging.AbstractReporter
endCategory, endCategory, getCategory, getCategoryFormatter, getReporter, getResourceBundle, getSourceID, getSourceIDString, registerErrorLogger, report, report, report, report, report, setCategoryFormatter, setDefaultOutputLevel, setResourceBundle, setSourceID, startCategory, unregisterErrorLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationReporter

public ValidationReporter()
create a new ValidationReporter

Method Detail

open

public void open()
Open for processing


isOpen

public boolean isOpen()
returns whether or not this reporter is open

Returns:
true if has been opened, false otherwise
See Also:
IReporter.open()

close

public void close()
close processing


flush

public void flush()
Flush any pending output


report

public void report(int level,
                   String message,
                   Object[] values)
report the message at the given level with the given substitution values

See Also:
IReporter.report(int, String)

report

public void report(int level,
                   String msg,
                   Throwable t)
reports an exception or error. This method can be used to direct the stack trace of the given throwable to the appropriate output for this reporter (e.g. a GUI text area or stream). The level of the throwable is determined by the specified level parameter.

Specified by:
report in interface IReporter
Overrides:
report in class AbstractReporter
Parameters:
level - - level of exception or error
msg - - optional message
t - - Throwable being reported

getLastReport

public String getLastReport()
get the last reported message

Returns:
last reported message

reset

public void reset()
reset the reporter. This method should clear all categories and all remaining buffers and report records.

Specified by:
reset in interface IReporter
Overrides:
reset in class AbstractReporter

getRecords

public ValidationReportRecord[] getRecords()
return all records logged by this reporter thus far

Returns:
all report records

getRecordCount

public int getRecordCount()
get the number of report records logged by this reporter

Returns:
record count

startReport

public void startReport(Object comp)
start a new report. Every call of this method must be matched with a corresponding endReport call.

Parameters:
comp - - root component for which report is being generated

endReport

public void endReport()
ends a report started with startReport. Once this method is called, the getLastReport method can be called in order to supply the report generated betwen the startReport call and this call.


lastReport

public ValidationReportRecord[] lastReport()

setLastReport

public void setLastReport(String reportText)
set the last report on this reporter. This method is only used in ValidationLauncher.DISTINCT_JVM after the launcher gets an indication that a report has completed.

Parameters:
reportText - - last report generated

addReportRecords

public void addReportRecords(List records)


getDefaultOutputLevel

public int getDefaultOutputLevel()
get the default output level.

Specified by:
getDefaultOutputLevel in interface IReporter
Overrides:
getDefaultOutputLevel in class AbstractReporter
Returns:
default output level
See Also:
IReporter.setDefaultOutputLevel(int)

addReportRecord

public void addReportRecord(ValidationReportRecord record)