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

java.lang.Object
  extended by edu.cmu.sei.aadl.modelsupport.errorreporting.AbstractErrorReporter
      extended by edu.cmu.sei.aadl.modelsupport.errorreporting.AbstractAnalysisErrorReporter
          extended by edu.cmu.sei.aadl.modelsupport.errorreporting.WriterAnalysisErrorReporter
All Implemented Interfaces:
AnalysisErrorReporter, ErrorReporter

public final class WriterAnalysisErrorReporter
extends AbstractAnalysisErrorReporter

An implementation of edu.cmu.sei.aadl.model.pluginsupport.AnalysisErrorReporter that outputs the messages to a Java Writer. Includes a prototype reference to a factory that creates reporters that print to the system out.

The class defines a nested class edu.cmu.sei.aadl.model.pluginsupport.WriterAnalysisErrorReporter.Factory that implements a factory.

Author:
aarong

Nested Class Summary
static class WriterAnalysisErrorReporter.Factory
           
 
Field Summary
static WriterAnalysisErrorReporter.Factory SYSTEM_ERR_FACTORY
          Singleton reference to a factory that creates reporters that send the messages to System.err.
static WriterAnalysisErrorReporter.Factory SYSTEM_OUT_FACTORY
          Singleton reference to a factory that creates reporters that send the messages to System.out.
 
Fields inherited from class edu.cmu.sei.aadl.modelsupport.errorreporting.AbstractAnalysisErrorReporter
resource
 
Constructor Summary
WriterAnalysisErrorReporter(org.eclipse.emf.ecore.resource.Resource rsrc, java.io.Writer writer)
          Create a new error reporter that writes the error messages to the given Writer object.
 
Method Summary
protected  void deleteMessagesImpl()
           
protected  void errorImpl(Element where, java.lang.String message, java.lang.String[] attrs, java.lang.Object[] values)
          Actual implementation of the error method.
protected  void infoImpl(Element where, java.lang.String message, java.lang.String[] attrs, java.lang.Object[] values)
          Actual implementation of the info method.
protected  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.AbstractAnalysisErrorReporter
error, info, warning
 
Methods inherited from class edu.cmu.sei.aadl.modelsupport.errorreporting.AbstractErrorReporter
deleteMessages, 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

SYSTEM_OUT_FACTORY

public static final WriterAnalysisErrorReporter.Factory SYSTEM_OUT_FACTORY
Singleton reference to a factory that creates reporters that send the messages to System.out.


SYSTEM_ERR_FACTORY

public static final WriterAnalysisErrorReporter.Factory SYSTEM_ERR_FACTORY
Singleton reference to a factory that creates reporters that send the messages to System.err.

Constructor Detail

WriterAnalysisErrorReporter

public WriterAnalysisErrorReporter(org.eclipse.emf.ecore.resource.Resource rsrc,
                                   java.io.Writer writer)
Create a new error reporter that writes the error messages to the given Writer object. The caller is responsible for providing any buffering, i.e., the writer will be used as provided and is not further wrapped.

Parameters:
writer - The writer to use.
Throws:
java.lang.IllegalArgumentException - Thrown if writer is null.
Method Detail

errorImpl

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

warningImpl

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

infoImpl

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

deleteMessagesImpl

protected void deleteMessagesImpl()
Specified by:
deleteMessagesImpl in class AbstractErrorReporter