Package eu.bandm.tools.message
Class MessagePasser<M extends Message>
java.lang.Object
eu.bandm.tools.message.SingleSender<M>
eu.bandm.tools.message.MessagePasser<M>
- Type Parameters:
M
- the message subtype propagated by this sender
- All Implemented Interfaces:
MessageReceiver<M>
- Direct Known Subclasses:
LLJavac.Messager
,MessageFormatter
,MessageTranslator
Simply passes every message it receives to a single target.
Is intented as a basis class for overriding the
receive(M)
method
and thus implementing filters and on-the-fly transformations.-
Field Summary
Fields inherited from class eu.bandm.tools.message.SingleSender
receiver
-
Constructor Summary
ConstructorDescriptionAfter calling this constructor, a call toSingleSender.setReceiver(MessageReceiver)
is necessary.MessagePasser
(MessageReceiver<? super M> r) Constructor which sets the receiver. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Will pass the received message to the currentSingleSender.receiver
.Methods inherited from class eu.bandm.tools.message.SingleSender
getReceiver, send, setReceiver
-
Constructor Details
-
MessagePasser
public MessagePasser()After calling this constructor, a call toSingleSender.setReceiver(MessageReceiver)
is necessary. Cf the documentation ofSingleSender
. -
MessagePasser
Constructor which sets the receiver.
-
-
Method Details
-
receive
Will pass the received message to the currentSingleSender.receiver
.
Intentionally, the code will crash if this is==null
- Specified by:
receive
in interfaceMessageReceiver<M extends Message>
-