Class KeyValuePlaceholder

java.lang.Object
ua.mcchickenstudio.opencreative.coding.placeholders.Placeholder
ua.mcchickenstudio.opencreative.coding.placeholders.KeyValuePlaceholder
All Implemented Interfaces:
ExtensionContent
Direct Known Subclasses:
ListPlaceholder, VarPlaceholder

public abstract class KeyValuePlaceholder extends Placeholder
  • Constructor Details

    • KeyValuePlaceholder

      public KeyValuePlaceholder(String... keys)
  • Method Details

    • getPattern

      public static Pattern getPattern()
    • getKeys

      public String[] getKeys()
    • parseKeyValue

      @Nullable public abstract @Nullable String parseKeyValue(String key, String value, ActionsHandler handler, Action action)
    • matches

      public boolean matches(String text)
      Description copied from class: Placeholder
      Returns true if specified text contains placeholders that can be parsed with this class.
      Specified by:
      matches in class Placeholder
      Parameters:
      text - text to check.
      Returns:
      true - placeholders detected, false - not detected.
    • parse

      @NotNull public @NotNull String parse(String text, ActionsHandler handler, Action action)
      Description copied from class: Placeholder
      Returns text with parsed placeholders from this class.
      Specified by:
      parse in class Placeholder
      Parameters:
      text - text to parse.
      handler - action handler.
      action - action.
      Returns:
      parsed text