Interface MiniMessage.Builder
-
- All Superinterfaces:
AbstractBuilder<MiniMessage>
- Enclosing interface:
- MiniMessage
public static interface MiniMessage.Builder extends AbstractBuilder<MiniMessage>
A builder forMiniMessage
.- Since:
- 4.10.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull MiniMessage
build()
Builds the serializer.@NotNull MiniMessage.Builder
debug(@Nullable java.util.function.Consumer<java.lang.String> debugOutput)
Print debug information to the given output (disabled by default).@NotNull MiniMessage.Builder
editTags(@NotNull java.util.function.Consumer<TagResolver.Builder> adder)
Add to the set of known tags this MiniMessage instance can use.@NotNull MiniMessage.Builder
postProcessor(@NotNull java.util.function.UnaryOperator<Component> postProcessor)
Specify a function that takes the component at the end of the parser process.@NotNull MiniMessage.Builder
preProcessor(@NotNull java.util.function.UnaryOperator<java.lang.String> preProcessor)
Specify a function that takes the string at the start of the parser process.@NotNull MiniMessage.Builder
strict(boolean strict)
Enables strict mode (disabled by default).@NotNull MiniMessage.Builder
tags(@NotNull TagResolver tags)
Set the known tags to the provided tag resolver.
-
-
-
Method Detail
-
tags
@NotNull @NotNull MiniMessage.Builder tags(@NotNull @NotNull TagResolver tags)
Set the known tags to the provided tag resolver.This resolver determines the base set of tags known to this
MiniMessage
instance. Any resolvers passed to theMiniMessage.deserialize(String, TagResolver)
method will override this resolver.- Parameters:
tags
- the tag resolver to use- Returns:
- this builder
- Since:
- 4.10.0
-
editTags
@NotNull @NotNull MiniMessage.Builder editTags(@NotNull @NotNull java.util.function.Consumer<TagResolver.Builder> adder)
Add to the set of known tags this MiniMessage instance can use.- Parameters:
adder
- a function operating on a builder containing currently known tags- Returns:
- this builder
- Since:
- 4.10.0
-
strict
@NotNull @NotNull MiniMessage.Builder strict(boolean strict)
Enables strict mode (disabled by default).By default, MiniMessage will allow
child-allowing
tags to be implicitly closed. When strict mode is enabled, all child-allowing tags which are<opened>
must be explicitly</closed>
as well.Additionally, the
reset tag
is disabled in this mode. Any usage of this tag will throw a parser exception if strict mode is enabled.- Parameters:
strict
- if strict mode should be enabled- Returns:
- this builder
- Since:
- 4.10.0
-
debug
@NotNull @NotNull MiniMessage.Builder debug(@Nullable @Nullable java.util.function.Consumer<java.lang.String> debugOutput)
Print debug information to the given output (disabled by default).Debug output includes detailed information about the parsing process to help debug parser behavior.
The consumer will receive line fragments terminated by
LF
, not complete lines. This avoids string concatenation within debug output generation. If the consumer isnull
, no debug information will be generated.- Parameters:
debugOutput
- if debug mode should be enabled- Returns:
- this builder
- Since:
- 4.10.0
-
postProcessor
@NotNull @NotNull MiniMessage.Builder postProcessor(@NotNull @NotNull java.util.function.UnaryOperator<Component> postProcessor)
Specify a function that takes the component at the end of the parser process.By default, this compacts the resulting component with
Component.compact()
.- Parameters:
postProcessor
- method run at the end of parsing- Returns:
- this builder
- Since:
- 4.10.0
-
preProcessor
@NotNull @NotNull MiniMessage.Builder preProcessor(@NotNull @NotNull java.util.function.UnaryOperator<java.lang.String> preProcessor)
Specify a function that takes the string at the start of the parser process.By default, this does absolutely nothing.
- Parameters:
preProcessor
- method run at the start of parsing- Returns:
- this builder
- Since:
- 4.11.0
-
build
@NotNull @NotNull MiniMessage build()
Builds the serializer.- Specified by:
build
in interfaceAbstractBuilder<MiniMessage>
- Returns:
- the built serializer
- Since:
- 4.10.0
-
-