Class PlainComponentSerializer
java.lang.Object
net.kyori.adventure.text.serializer.plain.PlainComponentSerializer
- All Implemented Interfaces:
net.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,net.kyori.adventure.text.TextComponent,String>
public class PlainComponentSerializer extends Object implements net.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,net.kyori.adventure.text.TextComponent,String>
A plain component serializer.
Plain does not support more complex features such as, but not limited
to, colours, decorations, ClickEvent
, and HoverEvent
.
- Since:
- 4.0.0
-
Constructor Summary
Constructors Constructor Description PlainComponentSerializer()
Constructs.PlainComponentSerializer(@Nullable Function<net.kyori.adventure.text.KeybindComponent,String> keybind, @Nullable Function<net.kyori.adventure.text.TranslatableComponent,String> translatable)
Constructs. -
Method Summary
Modifier and Type Method Description @NonNull net.kyori.adventure.text.TextComponent
deserialize(@NonNull String input)
static @NonNull PlainComponentSerializer
plain()
A component serializer for plain-based serialization and deserialization.void
serialize(@NonNull StringBuilder sb, @NonNull net.kyori.adventure.text.Component component)
Serializes.@NonNull String
serialize(@NonNull net.kyori.adventure.text.Component component)
-
Constructor Details
-
PlainComponentSerializer
public PlainComponentSerializer()Constructs.- Since:
- 4.0.0
-
PlainComponentSerializer
public PlainComponentSerializer(@Nullable Function<net.kyori.adventure.text.KeybindComponent,String> keybind, @Nullable Function<net.kyori.adventure.text.TranslatableComponent,String> translatable)Constructs.- Parameters:
keybind
- the keybind renderertranslatable
- the translatable renderer- Since:
- 4.0.0
-
-
Method Details
-
plain
A component serializer for plain-based serialization and deserialization.- Returns:
- serializer instance
- Since:
- 4.0.0
-
deserialize
- Specified by:
deserialize
in interfacenet.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,net.kyori.adventure.text.TextComponent,String>
-
serialize
- Specified by:
serialize
in interfacenet.kyori.adventure.text.serializer.ComponentSerializer<net.kyori.adventure.text.Component,net.kyori.adventure.text.TextComponent,String>
-
serialize
public void serialize(@NonNull StringBuilder sb, @NonNull net.kyori.adventure.text.Component component)Serializes.- Parameters:
sb
- the string buildercomponent
- the component- Since:
- 4.0.0
-