Class MessageReceiver
java.lang.Object
net.ssehub.easy.dslCore.translation.MessageReceiver
- All Implemented Interfaces:
IMessageReceiver
- Direct Known Subclasses:
ExpressionTranslator,LogMessageReceiver,ModelTranslator
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 -
Method Summary
Modifier and TypeMethodDescriptionabstract voidaddMessage(Message msg) Adds a message.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 intReturns the number of errors.abstract MessagegetMessage(int index) Returns the specified message.abstract intReturns the number of messages.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.ssehub.easy.dslCore.translation.IMessageReceiver
collect, error, warning
-
Constructor Details
-
MessageReceiver
public MessageReceiver()
-
-
Method Details
-
error
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
Returns the specified message.- Parameters:
index- the position of the message to be returned- Returns:
- the specified message
- Throws:
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
-
addMessage
Adds a message.- Parameters:
msg- the message to be added
-