Class MessageProcessor
java.lang.Object
com.winterhavenmc.library.messagebuilder.pipeline.processor.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
(Resolver resolver, Matcher placeholderMatcher) Constructs aMessageProcessor
using the providedResolver
andMatcher
to configure the underlyingMacroReplacer
. -
Method Summary
Modifier and TypeMethodDescriptionprocess
(ValidMessageRecord messageRecord, MacroObjectMap macroObjectMap) Processes aValidMessageRecord
by replacing all macros in its fields using the providedMacroObjectMap
.
-
Constructor Details
-
MessageProcessor
Constructs aMessageProcessor
using the providedResolver
andMatcher
to 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 aValidMessageRecord
by replacing all macros in its fields using the providedMacroObjectMap
.This includes the
message
,title
, andsubtitle
fields, which are resolved and returned as part of a newFinalMessageRecord
.
-