Package com.winterhavenmc.library.messagebuilder.pipeline.replacer


package com.winterhavenmc.library.messagebuilder.pipeline.replacer
Contains interfaces and classes responsible for replacing macros in message strings using resolved values from a MacroObjectMap.

This package represents the final stage in the message-building pipeline, where macros such as %PLAYER_NAME% or [LOCATION.X} are substituted with their corresponding string values.

Key Components

  • Replacer – The abstraction for any macro replacement engine.
  • MacroReplacer – The default implementation that uses regex-based detection and a Resolver to perform context-aware substitution.

Macro resolution depends on objects provided earlier in the pipeline via Message.setMacro(Enum, Object). These objects are transformed into strings by the Resolver system before replacement occurs.

Unresolvable macros are left untouched in the final message, ensuring robustness and avoiding runtime failures due to incomplete context.

See Also:
  • Class
    Description
    Default implementation of the Replacer interface that performs macro substitution on input strings using values derived from a MacroObjectMap.
    A functional interface representing a macro replacement engine that substitutes placeholder values within a message string using data from a MacroObjectMap.