Interface ReplacementProcessor
- All Known Implementing Classes:
PlaceholderProcessor
public interface ReplacementProcessor
Defines the contract for processing text and injecting dynamic data.
This interface is responsible for taking a template (String or List of Strings)
and applying a series of
Replacement objects to produce the final output.- Since:
- 0.1
- Author:
- a8kj7sea
-
Method Summary
Modifier and TypeMethodDescriptionprocess(String text, Replacement... replacements) Processes a single string by applying the provided replacements.process(List<String> lines, Replacement... replacements) Processes a list of strings (e.g., a configuration's lore or multi-line message).
-
Method Details
-
process
Processes a single string by applying the provided replacements.- Parameters:
text- the raw text containing placeholders.replacements- a varargs ofReplacementto be applied.- Returns:
- the processed string with all placeholders resolved.
- Since:
- 0.1
-
process
Processes a list of strings (e.g., a configuration's lore or multi-line message). This default implementation uses Java Streams to map each line through theprocess(String, Replacement...)method.- Parameters:
lines- the list of template lines.replacements- a varargs ofReplacementto be applied to every line.- Returns:
- a new list containing the processed strings.
- Since:
- 0.1
-