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

java.lang.Object
  extended by edu.cmu.sei.aadl.modelsupport.errorreporting.AbstractErrorReporter
      extended by edu.cmu.sei.aadl.modelsupport.errorreporting.AbstractParseErrorReporter
          extended by edu.cmu.sei.aadl.modelsupport.errorreporting.WriterParseErrorReporter
All Implemented Interfaces:
ErrorReporter, ParseErrorReporter

public final class WriterParseErrorReporter
extends AbstractParseErrorReporter

An implementation of edu.cmu.sei.aadl.model.pluginsupport.ParseErrorReporter 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.WriterParseErrorReporter.Factory that implements a factory.

Author:
aarong

Nested Class Summary
static class WriterParseErrorReporter.Factory
           
 
Field Summary
static WriterParseErrorReporter SYSTEM_ERR
          Singleton reference to an error reporter that sends the messages to System.err.
static WriterParseErrorReporter SYSTEM_OUT
          Singleton reference to an error reporter that sends the messages to System.out.
static WriterParseErrorReporter.Factory SYSTEM_OUT_FACTORY
          Singleton reference to an factory that creates reporters that send the messages to System.out.
 
Constructor Summary
WriterParseErrorReporter(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(java.lang.String filename, int line, java.lang.String message)
           
protected  void infoImpl(java.lang.String filename, int line, java.lang.String message)
           
protected  void warningImpl(java.lang.String filename, int line, java.lang.String message)
           
 
Methods inherited from class edu.cmu.sei.aadl.modelsupport.errorreporting.AbstractParseErrorReporter
error, error, info, info, warning, 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

public static final WriterParseErrorReporter SYSTEM_OUT
Singleton reference to an error reporter that sends the messages to System.out.


SYSTEM_ERR

public static final WriterParseErrorReporter SYSTEM_ERR
Singleton reference to an error reporter that sends the messages to System.err.


SYSTEM_OUT_FACTORY

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

Constructor Detail

WriterParseErrorReporter

public WriterParseErrorReporter(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(java.lang.String filename,
                         int line,
                         java.lang.String message)
Specified by:
errorImpl in class AbstractParseErrorReporter

warningImpl

protected void warningImpl(java.lang.String filename,
                           int line,
                           java.lang.String message)
Specified by:
warningImpl in class AbstractParseErrorReporter

infoImpl

protected void infoImpl(java.lang.String filename,
                        int line,
                        java.lang.String message)
Specified by:
infoImpl in class AbstractParseErrorReporter

deleteMessagesImpl

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