Class Placeholders
java.lang.Object
ua.mcchickenstudio.opencreative.coding.placeholders.Placeholders
Placeholders
This class represents a placeholders storage, that has methods to register custom placeholders.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull PlaceholdersReturns instance of placeholders controller class.@NotNull List<Placeholder> Returns a copy of list that contains all registered placeholders.@NotNull StringparsePlaceholders(String text, ActionsHandler handler, Action action) Returns text with parsed placeholders.voidregisterPlaceholder(@NotNull Placeholder placeholder) Registers placeholder, that will be parsed in text coding values.voidunregisterPlaceholder(@NotNull Placeholder placeholder) Unregisters placeholder if list contains it.
-
Constructor Details
-
Placeholders
public Placeholders()
-
-
Method Details
-
getInstance
Returns instance of placeholders controller class.- Returns:
- instance of placeholders.
-
registerPlaceholder
Registers placeholder, that will be parsed in text coding values.- Parameters:
placeholder- placeholder to register.
-
unregisterPlaceholder
Unregisters placeholder if list contains it.- Parameters:
placeholder- placeholder to unregister.
-
getPlaceholders
Returns a copy of list that contains all registered placeholders.- Returns:
- placeholders list.
-
parsePlaceholders
@NotNull public @NotNull String parsePlaceholders(String text, ActionsHandler handler, Action action) Returns text with parsed placeholders.- Parameters:
text- text to parse.handler- action handler.action- action.- Returns:
- parsed text.
-