edu.cmu.sei.aadl.modelsupport.errorreporting
Class AbstractErrorReporter

java.lang.Object
  extended by edu.cmu.sei.aadl.modelsupport.errorreporting.AbstractErrorReporter
All Implemented Interfaces:
ErrorReporter
Direct Known Subclasses:
AbstractAnalysisErrorReporter, AbstractParseErrorReporter

public abstract class AbstractErrorReporter
extends java.lang.Object
implements ErrorReporter

Base implementation that handles tracking messages counts and message deletion. Delegates the actual message deletion functionaliy to deleteMessagesImpl().

Author:
aarong

Constructor Summary
protected AbstractErrorReporter()
           
 
Method Summary
 void deleteMessages()
          Clear the record of the messages.
protected abstract  void deleteMessagesImpl()
           
 int getNumErrors()
          Get the number of parse errors reported using this reporter object since it was created or since the last call to ErrorReporter.deleteMessages().
 int getNumInfos()
          Get the number of infos reported using this reporter object since it was created or since the last call to ErrorReporter.deleteMessages().
 int getNumMessages()
          Get the number of messages, that is errors, warnings, and information messages, reported using this reporter object since it was created or since the last call to ErrorReporter.deleteMessages().
 int getNumWarnings()
          Get the number of warnings reported using this reporter object since it was created or since the last call to ErrorReporter.deleteMessages().
protected  void incError()
           
protected  void incInfo()
           
protected  void incWarning()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractErrorReporter

protected AbstractErrorReporter()
Method Detail

deleteMessages

public final void deleteMessages()
Description copied from interface: ErrorReporter
Clear the record of the messages. The error reporter should (if possible) remove any messages, for example by deleting output log files, or removing markers. This is not always possible, for example, if the messages are sent to a console. The messages counts are also reset to zero.

Specified by:
deleteMessages in interface ErrorReporter

deleteMessagesImpl

protected abstract void deleteMessagesImpl()

incError

protected final void incError()

getNumErrors

public final int getNumErrors()
Description copied from interface: ErrorReporter
Get the number of parse errors reported using this reporter object since it was created or since the last call to ErrorReporter.deleteMessages().

Specified by:
getNumErrors in interface ErrorReporter

incWarning

protected final void incWarning()

getNumWarnings

public final int getNumWarnings()
Description copied from interface: ErrorReporter
Get the number of warnings reported using this reporter object since it was created or since the last call to ErrorReporter.deleteMessages().

Specified by:
getNumWarnings in interface ErrorReporter

incInfo

protected final void incInfo()

getNumInfos

public final int getNumInfos()
Description copied from interface: ErrorReporter
Get the number of infos reported using this reporter object since it was created or since the last call to ErrorReporter.deleteMessages().

Specified by:
getNumInfos in interface ErrorReporter

getNumMessages

public final int getNumMessages()
Description copied from interface: ErrorReporter
Get the number of messages, that is errors, warnings, and information messages, reported using this reporter object since it was created or since the last call to ErrorReporter.deleteMessages().

Specified by:
getNumMessages in interface ErrorReporter