Class MessageReceiver

java.lang.Object
net.ssehub.easy.dslCore.translation.MessageReceiver
All Implemented Interfaces:
IMessageReceiver
Direct Known Subclasses:
ExpressionTranslator, LogMessageReceiver, ModelTranslator

public abstract class MessageReceiver extends Object implements IMessageReceiver
A class which is able to receive and handle messages. Unifies expression translator and model translator in this regard and may be used to realize other message handling strategies in future.
Author:
Holger Eichelberger
  • Constructor Details

    • MessageReceiver

      public MessageReceiver()
  • Method Details

    • error

      public void error(TranslatorException exception)
      Receives an error message in terms of a TranslatorException.
      Parameters:
      exception - the exception to be used to derive the error cause and location from
    • getMessageCount

      public abstract int getMessageCount()
      Returns the number of messages.
      Returns:
      the number of messages
    • getErrorCount

      public abstract int getErrorCount()
      Returns the number of errors.
      Returns:
      the number of errors
    • getMessage

      public abstract Message getMessage(int index)
      Returns the specified message.
      Parameters:
      index - the position of the message to be returned
      Returns:
      the specified message
      Throws:
      IndexOutOfBoundsException - if index<0 || index>=getMessageCount()
    • error

      public abstract void error(org.eclipse.emf.ecore.resource.Resource.Diagnostic diagnostic)
      Adds a diagnostic error, typically from a standalone parser configuration.
      Parameters:
      diagnostic - the diagnostic to be added
    • addMessage

      public abstract void addMessage(Message msg)
      Adds a message.
      Parameters:
      msg - the message to be added