public class GsonComponentSerializer
extends java.lang.Object
implements net.kyori.text.serializer.ComponentSerializer<net.kyori.text.Component,net.kyori.text.Component,java.lang.String>, com.google.gson.JsonDeserializer<net.kyori.text.Component>, com.google.gson.JsonSerializer<net.kyori.text.Component>
| Modifier and Type | Field and Description |
|---|---|
static GsonComponentSerializer |
INSTANCE
A component serializer for JSON-based serialization and deserialization.
|
| Constructor and Description |
|---|
GsonComponentSerializer() |
| Modifier and Type | Method and Description |
|---|---|
net.kyori.text.Component |
deserialize(com.google.gson.JsonElement json,
java.lang.reflect.Type typeOfT,
com.google.gson.JsonDeserializationContext context)
Deprecated.
|
@NonNull net.kyori.text.Component |
deserialize(@NonNull java.lang.String string) |
static @NonNull com.google.gson.GsonBuilder |
populate(@NonNull com.google.gson.GsonBuilder builder)
Populate a builder with our serializers.
|
@NonNull java.lang.String |
serialize(@NonNull net.kyori.text.Component component) |
com.google.gson.JsonElement |
serialize(net.kyori.text.Component src,
java.lang.reflect.Type typeOfSrc,
com.google.gson.JsonSerializationContext context)
Deprecated.
|
public static final GsonComponentSerializer INSTANCE
public static @NonNull com.google.gson.GsonBuilder populate(@NonNull com.google.gson.GsonBuilder builder)
builder - the gson builderpublic @NonNull net.kyori.text.Component deserialize(@NonNull java.lang.String string)
deserialize in interface net.kyori.text.serializer.ComponentSerializer<net.kyori.text.Component,net.kyori.text.Component,java.lang.String>public @NonNull java.lang.String serialize(@NonNull net.kyori.text.Component component)
serialize in interface net.kyori.text.serializer.ComponentSerializer<net.kyori.text.Component,net.kyori.text.Component,java.lang.String>@Deprecated
public net.kyori.text.Component deserialize(com.google.gson.JsonElement json,
java.lang.reflect.Type typeOfT,
com.google.gson.JsonDeserializationContext context)
throws com.google.gson.JsonParseException
deserialize in interface com.google.gson.JsonDeserializer<net.kyori.text.Component>com.google.gson.JsonParseException@Deprecated
public com.google.gson.JsonElement serialize(net.kyori.text.Component src,
java.lang.reflect.Type typeOfSrc,
com.google.gson.JsonSerializationContext context)
serialize in interface com.google.gson.JsonSerializer<net.kyori.text.Component>