Class Placeholders

java.lang.Object
ua.mcchickenstudio.opencreative.coding.placeholders.Placeholders

public final class Placeholders extends Object

Placeholders

This class represents a placeholders storage, that has methods to register custom placeholders.
See Also:
  • Constructor Details

    • Placeholders

      public Placeholders()
  • Method Details

    • getInstance

      @NotNull public static @NotNull Placeholders getInstance()
      Returns instance of placeholders controller class.
      Returns:
      instance of placeholders.
    • registerPlaceholder

      public void registerPlaceholder(@NotNull @NotNull Placeholder placeholder)
      Registers placeholder, that will be parsed in text coding values.
      Parameters:
      placeholder - placeholder to register.
    • unregisterPlaceholder

      public void unregisterPlaceholder(@NotNull @NotNull Placeholder placeholder)
      Unregisters placeholder if list contains it.
      Parameters:
      placeholder - placeholder to unregister.
    • getPlaceholders

      @NotNull public @NotNull List<Placeholder> 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.