public interface TokenEmitter
A consumer of tokens used to generate MiniMessage output.
Since:
4.10.0
  • Method Details

    • tag

      TokenEmitter tag(String token)
      Open a tag with or without arguments.
      Parameters:
      token - the token to emit
      Returns:
      this emitter
      Since:
      4.10.0
    • selfClosingTag

      TokenEmitter selfClosingTag(String token)
      Open a tag with or without arguments that cannot have children.

      These sorts of tags will be closed even without any sort of closing indicator.

      Parameters:
      token - the token to emit
      Returns:
      this emitter
      Since:
      4.10.0
    • arguments

      default TokenEmitter arguments(String... args)
      Add arguments to the current tag.

      Must be called after tag(String), but before any call to text(String).

      Parameters:
      args - args to add
      Returns:
      this emitter
      Since:
      4.10.0
    • argument

      TokenEmitter argument(String arg)
      Add a single argument to the current tag.

      Must be called after tag(String), but before any call to text(String).

      Parameters:
      arg - argument to add
      Returns:
      this emitter
      Since:
      4.10.0
    • argument

      TokenEmitter argument(String arg, QuotingOverride quotingPreference)
      Add a single argument to the current tag.

      Must be called after tag(String), but before any call to text(String).

      Parameters:
      arg - argument to add
      quotingPreference - an argument-specific quoting instruction
      Returns:
      this emitter
      Since:
      4.10.0
    • argument

      TokenEmitter argument(Component arg)
      Add a single argument to the current tag.

      Must be called after tag(String), but before any call to text(String).

      Parameters:
      arg - argument to add, serialized as a nested MiniMessage string
      Returns:
      this emitter
      Since:
      4.10.0
    • text

      TokenEmitter text(String text)
      Emit literal text.

      Escaping will be automatically performed to ensure that none of the contents of text are parsed as tags.

      Parameters:
      text - the text to parse
      Returns:
      this emitter
      Since:
      4.10.0
    • pop

      Explicitly end a token, only needed if there are multiple tokens within an Emitable for some reason.

      Usually depth handling is performed internally.

      Returns:
      this emitter
      Since:
      4.10.0