Class Placeholder

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

public abstract class Placeholder extends Object implements ExtensionContent

Placeholder

This class represents a special text, that will be replaced while parsing text coding values.
See Also:
  • Constructor Details

    • Placeholder

      public Placeholder()
  • Method Details

    • matches

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

      @NotNull public abstract @NotNull String parse(String text, ActionsHandler handler, Action action)
      Returns text with parsed placeholders from this class.
      Parameters:
      text - text to parse.
      handler - action handler.
      action - action.
      Returns:
      parsed text
    • toString

      public String toString()
      Overrides:
      toString in class Object