Package me.deecaad.core.placeholder
Class PlaceholderMessage
java.lang.Object
me.deecaad.core.placeholder.PlaceholderMessage
Represents a message template that can contain placeholders. This class is used to process and
replace these placeholders with desired values.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPlaceholderMessage(@NotNull String template) Constructs a new PlaceholderMessage based on the provided template string. -
Method Summary
Modifier and TypeMethodDescriptionvoidfillMap(PlaceholderData data) Generates a map where the keys are the identified placeholders in the template, and the values are all set to null.Gets an immutable set of PlaceholderHandler objects that were identified in the template.Returns the template string with all placeholders converted to lowercase.net.kyori.adventure.text.Component
-
Field Details
-
TAG
- See Also:
-
TAG_PATTERN
-
-
Constructor Details
-
PlaceholderMessage
Constructs a new PlaceholderMessage based on the provided template string.Custom placeholders (placeholders not registered with a
PlaceholderHandler) may be used if you add them.- Parameters:
template- The template string containing potential placeholders.
-
-
Method Details
-
getTemplate
Returns the template string with all placeholders converted to lowercase.- Returns:
- The processed template string.
-
getPresentPlaceholders
Gets an immutable set of PlaceholderHandler objects that were identified in the template.- Returns:
- A set of identified placeholders.
-
fillMap
Generates a map where the keys are the identified placeholders in the template, and the values are all set to null. The placeholders are added to the map stored indata.- Parameters:
data- The data to pass to the placeholder handlers.
-
replaceAndDeserialize
-