Class MessageProcessor
java.lang.Object
com.winterhavenmc.library.messagebuilder.adapters.pipeline.processors.MessageProcessor
- All Implemented Interfaces:
Processor
Default implementation of the
Processor interface responsible for performing
macro replacement on message fields.
This class uses a MacroReplacer
to apply all relevant placeholder substitutions on a
ValidMessageRecord,
producing a new FinalMessageRecord
with all final strings populated.
It serves as the final step in the message pipeline before rendering or dispatching.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMessageProcessor(ValueResolver resolver, PlaceholderMatcher placeholderMatcher) Constructs aMessageProcessorusing the providedValueResolverandPlaceholderMatcherto configure the underlyingMacroReplacer. -
Method Summary
Modifier and TypeMethodDescriptionprocess(ValidMessageRecord messageRecord, MacroObjectMap macroObjectMap) Processes aValidMessageRecordby replacing all macros in its fields using the providedMacroObjectMap, and return new message record with final string fields added with macro replacements performed.
-
Constructor Details
-
MessageProcessor
Constructs aMessageProcessorusing the providedValueResolverandPlaceholderMatcherto configure the underlyingMacroReplacer.- Parameters:
resolver- the macro resolver used to extract string representations from context objectsplaceholderMatcher- the placeholder matcher used to detect macro keys in strings
-
-
Method Details
-
process
Processes aValidMessageRecordby replacing all macros in its fields using the providedMacroObjectMap, and return new message record with final string fields added with macro replacements performed.This includes the
message,title, andsubtitlefields, which are resolved and returned as part of a newFinalMessageRecord.
-