Interface TokenEmitter
public interface TokenEmitter
A consumer of tokens used to generate MiniMessage output.
- Since:
- 4.10.0
-
Method Summary
Modifier and TypeMethodDescriptionAdd a single argument to the current tag.argument(String arg, QuotingOverride quotingPreference) Add a single argument to the current tag.Add a single argument to the current tag.default TokenEmitterAdd arguments to the current tag.pop()Explicitly end a token, only needed if there are multiple tokens within anEmitablefor some reason.selfClosingTag(String token) Open a tag with or without arguments that cannot have children.Open a tag with or without arguments.Emit literal text.
-
Method Details
-
tag
Open a tag with or without arguments.- Parameters:
token- the token to emit- Returns:
- this emitter
- Since:
- 4.10.0
-
selfClosingTag
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
Add arguments to the current tag.Must be called after
tag(String), but before any call totext(String).- Parameters:
args- args to add- Returns:
- this emitter
- Since:
- 4.10.0
-
argument
Add a single argument to the current tag.Must be called after
tag(String), but before any call totext(String).- Parameters:
arg- argument to add- Returns:
- this emitter
- Since:
- 4.10.0
-
argument
Add a single argument to the current tag.Must be called after
tag(String), but before any call totext(String).- Parameters:
arg- argument to addquotingPreference- an argument-specific quoting instruction- Returns:
- this emitter
- Since:
- 4.10.0
-
argument
Add a single argument to the current tag.Must be called after
tag(String), but before any call totext(String).- Parameters:
arg- argument to add, serialized as a nested MiniMessage string- Returns:
- this emitter
- Since:
- 4.10.0
-
text
Emit literal text.Escaping will be automatically performed to ensure that none of the contents of
textare parsed as tags.- Parameters:
text- the text to parse- Returns:
- this emitter
- Since:
- 4.10.0
-
pop
TokenEmitter pop()Explicitly end a token, only needed if there are multiple tokens within anEmitablefor some reason.Usually depth handling is performed internally.
- Returns:
- this emitter
- Since:
- 4.10.0
-