edu.cmu.sei.aadl.modelsupport.errorreporting
Class WriterParseErrorReporter
java.lang.Object
edu.cmu.sei.aadl.modelsupport.errorreporting.AbstractErrorReporter
edu.cmu.sei.aadl.modelsupport.errorreporting.AbstractParseErrorReporter
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
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
.
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
.
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