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
,MessageAsync
,MessageFormatter
,MessageKindFilter
,MessageLevelFilter
,MessageLocationFilter
,MessageStripExceptions
,MessageSync
,MessageTranslator
,MessageTranslator
Simply passes every message it receives to a single drain.
Is intended 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
drain
-
Constructor Summary
ConstructorsConstructorDescriptionAfter calling this constructor, a call toSingleSender.setDrain(MessageReceiver)
is necessary.MessagePasser
(@Opt MessageReceiver<? super M> r) Constructor which sets the drain. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Will pass the received message to the currentSingleSender.drain
.Methods inherited from class eu.bandm.tools.message.SingleSender
getDrain, getReceiver, send, setDrain, setReceiver
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface eu.bandm.tools.message.MessageReceiver
ifSubcriticalThen, ifSubcriticalThen, ifSubcriticalThenElse
-
Constructor Details
-
MessagePasser
public MessagePasser()After calling this constructor, a call toSingleSender.setDrain(MessageReceiver)
is necessary.- See Also:
-
MessagePasser
Constructor which sets the drain.- Parameters:
r
- the drain for all passed messages.
-
-
Method Details
-
receive
Will pass the received message to the currentSingleSender.drain
.Intentionally, the code will crash if that value is currently null.
- Specified by:
receive
in interfaceMessageReceiver<M extends Message>
- Parameters:
m
- the message to receive.
-