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 java.lang.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 Summary
Constructors Constructor Description MessageReceiver()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiderror(TranslatorException exception)Receives an error message in terms of aTranslatorException.abstract voiderror(org.eclipse.emf.ecore.resource.Resource.Diagnostic diagnostic)Adds a diagnostic error, typically from a standalone parser configuration.abstract intgetErrorCount()Returns the number of errors.abstract MessagegetMessage(int index)Returns the specified message.abstract intgetMessageCount()Returns the number of messages.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.ssehub.easy.dslCore.translation.IMessageReceiver
collect, error, warning
-
-
-
-
Method Detail
-
error
public void error(TranslatorException exception)
Receives an error message in terms of aTranslatorException.- 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:
java.lang.IndexOutOfBoundsException- ifindex<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
-
-