public static class Text.Serializer extends Object implements JsonDeserializer<MutableText>, JsonSerializer<Text>
Text
.Modifier and Type | Field and Description |
---|---|
private static Gson |
GSON |
private static Field |
JSON_READER_LINE_START |
private static Field |
JSON_READER_POS |
Constructor and Description |
---|
Serializer() |
Modifier and Type | Method and Description |
---|---|
private void |
addStyle(Style style,
JsonObject json,
JsonSerializationContext context) |
MutableText |
deserialize(JsonElement jsonElement,
Type type,
JsonDeserializationContext jsonDeserializationContext) |
static MutableText |
fromJson(JsonElement json) |
static MutableText |
fromJson(String json) |
static MutableText |
fromJson(com.mojang.brigadier.StringReader reader) |
static MutableText |
fromLenientJson(String json) |
private static int |
getPosition(JsonReader reader) |
JsonElement |
serialize(Text text,
Type type,
JsonSerializationContext jsonSerializationContext) |
static String |
toJson(Text text) |
static JsonElement |
toJsonTree(Text text) |
private static final Gson GSON
private static final Field JSON_READER_POS
private static final Field JSON_READER_LINE_START
public MutableText deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException
deserialize
in interface JsonDeserializer<MutableText>
JsonParseException
private void addStyle(Style style, JsonObject json, JsonSerializationContext context)
public JsonElement serialize(Text text, Type type, JsonSerializationContext jsonSerializationContext)
serialize
in interface JsonSerializer<Text>
public static JsonElement toJsonTree(Text text)
@Nullable public static MutableText fromJson(String json)
@Nullable public static MutableText fromJson(JsonElement json)
@Nullable public static MutableText fromLenientJson(String json)
public static MutableText fromJson(com.mojang.brigadier.StringReader reader)
private static int getPosition(JsonReader reader)