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

java.lang.Object
  extended by edu.cmu.sei.aadl.modelsupport.errorreporting.AbstractErrorReporter
      extended by edu.cmu.sei.aadl.modelsupport.errorreporting.AbstractAnalysisErrorReporter
All Implemented Interfaces:
AnalysisErrorReporter, ErrorReporter
Direct Known Subclasses:
AnalysisToParseErrorReporterAdapter, ChainedAnalysisErrorReporter, LogAnalysisErrorReporter, MarkerAnalysisErrorReporter, NullAnalysisErrorReporter, QueuingAnalysisErrorReporter, StringBufferAnalysisErrorReporter, WriterAnalysisErrorReporter

public abstract class AbstractAnalysisErrorReporter
extends AbstractErrorReporter
implements AnalysisErrorReporter

Base implementation that makes sure messages counts are updated. Also makes sure that that AObjects used for reporting all come from the same Resource. Delegates the actual reporting functionality to the abstract methods errorImpl(Element, String, String[], Object[]), warningImpl(Element, String, String[], Object[]), and infoImpl(Element, String, String[], Object[]).

Author:
aarong

Field Summary
protected  org.eclipse.emf.ecore.resource.Resource resource
          The EMF Resource of the object model.
 
Constructor Summary
protected AbstractAnalysisErrorReporter(org.eclipse.emf.ecore.resource.Resource rsrc)
           
 
Method Summary
 void error(Element where, java.lang.String message, java.lang.String[] attrs, java.lang.Object[] values)
          Report an error on an AObject (AADL object model object).
protected abstract  void errorImpl(Element where, java.lang.String message, java.lang.String[] attrs, java.lang.Object[] values)
          Actual implementation of the error method.
 void info(Element where, java.lang.String message, java.lang.String[] attrs, java.lang.Object[] values)
          Report an information message on an AObject (AADL object model object).
protected abstract  void infoImpl(Element where, java.lang.String message, java.lang.String[] attrs, java.lang.Object[] values)
          Actual implementation of the info method.
 void warning(Element where, java.lang.String message, java.lang.String[] attrs, java.lang.Object[] values)
          Report a warning on an AObject (AADL object model object).
protected abstract  void warningImpl(Element where, java.lang.String message, java.lang.String[] attrs, java.lang.Object[] values)
          Actual implementation of the warning method.
 
Methods inherited from class edu.cmu.sei.aadl.modelsupport.errorreporting.AbstractErrorReporter
deleteMessages, deleteMessagesImpl, getNumErrors, getNumInfos, getNumMessages, getNumWarnings, incError, incInfo, incWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.cmu.sei.aadl.modelsupport.errorreporting.ErrorReporter
deleteMessages, getNumErrors, getNumInfos, getNumMessages, getNumWarnings
 

Field Detail

resource

protected final org.eclipse.emf.ecore.resource.Resource resource
The EMF Resource of the object model.

Constructor Detail

AbstractAnalysisErrorReporter

protected AbstractAnalysisErrorReporter(org.eclipse.emf.ecore.resource.Resource rsrc)
Method Detail

error

public final void error(Element where,
                        java.lang.String message,
                        java.lang.String[] attrs,
                        java.lang.Object[] values)
Description copied from interface: AnalysisErrorReporter
Report an error on an AObject (AADL object model object). The error may have additional attributes to be used by the reporter.

Specified by:
error in interface AnalysisErrorReporter
Parameters:
where - the object to which the marker is pointing
message - the message as string
attrs - attributes of the error to be set
values - the values to set the attributes to.

errorImpl

protected abstract void errorImpl(Element where,
                                  java.lang.String message,
                                  java.lang.String[] attrs,
                                  java.lang.Object[] values)
Actual implementation of the error method. It is guaranteed that

warning

public final void warning(Element where,
                          java.lang.String message,
                          java.lang.String[] attrs,
                          java.lang.Object[] values)
Description copied from interface: AnalysisErrorReporter
Report a warning on an AObject (AADL object model object). The warning may have additional attributes to be used by the reporter.

Specified by:
warning in interface AnalysisErrorReporter
Parameters:
where - the object to which the marker is pointing
message - the message as string
attrs - attributes of the error to be set
values - the values to set the attributes to.

warningImpl

protected abstract void warningImpl(Element where,
                                    java.lang.String message,
                                    java.lang.String[] attrs,
                                    java.lang.Object[] values)
Actual implementation of the warning method. It is guaranteed that

info

public final void info(Element where,
                       java.lang.String message,
                       java.lang.String[] attrs,
                       java.lang.Object[] values)
Description copied from interface: AnalysisErrorReporter
Report an information message on an AObject (AADL object model object). The information may have additional attributes to be used by the reporter.

Specified by:
info in interface AnalysisErrorReporter
Parameters:
where - the object to which the marker is pointing
message - the message as string
attrs - attributes of the error to be set
values - the values to set the attributes to.

infoImpl

protected abstract void infoImpl(Element where,
                                 java.lang.String message,
                                 java.lang.String[] attrs,
                                 java.lang.Object[] values)
Actual implementation of the info method. It is guaranteed that