public static class ITextComponent.Serializer extends java.lang.Object implements com.google.gson.JsonDeserializer<ITextComponent>, com.google.gson.JsonSerializer<ITextComponent>
コンストラクタと説明 |
---|
Serializer() |
修飾子とタイプ | メソッドと説明 |
---|---|
ITextComponent |
deserialize(com.google.gson.JsonElement p_deserialize_1_,
java.lang.reflect.Type p_deserialize_2_,
com.google.gson.JsonDeserializationContext p_deserialize_3_)
Gson invokes this call-back method during deserialization when it encounters a field of the
specified type.
|
static ITextComponent |
fromJson(com.google.gson.JsonElement p_197672_0_) |
static ITextComponent |
fromJson(java.lang.String json)
Parses a JSON string into a
ITextComponent , with strict parsing. |
static ITextComponent |
fromJson(com.mojang.brigadier.StringReader p_197671_0_) |
static ITextComponent |
fromJsonLenient(java.lang.String json)
Parses a JSON string into a
ITextComponent , being lenient upon parse errors. |
com.google.gson.JsonElement |
serialize(ITextComponent p_serialize_1_,
java.lang.reflect.Type p_serialize_2_,
com.google.gson.JsonSerializationContext p_serialize_3_)
Gson invokes this call-back method during serialization when it encounters a field of the
specified type.
|
static java.lang.String |
toJson(ITextComponent component)
Serializes a component into JSON.
|
static com.google.gson.JsonElement |
toJsonTree(ITextComponent p_200528_0_) |
public ITextComponent deserialize(com.google.gson.JsonElement p_deserialize_1_, java.lang.reflect.Type p_deserialize_2_, com.google.gson.JsonDeserializationContext p_deserialize_3_) throws com.google.gson.JsonParseException
com.google.gson.JsonDeserializer
In the implementation of this call-back method, you should consider invoking
JsonDeserializationContext.deserialize(JsonElement, Type)
method to create objects
for any non-trivial field of the returned object. However, you should never invoke it on the
the same type passing json
since that will cause an infinite loop (Gson will call your
call-back method again).
deserialize
インタフェース内 com.google.gson.JsonDeserializer<ITextComponent>
p_deserialize_1_
- The Json data being deserializedp_deserialize_2_
- The type of the Object to deserialize toT
com.google.gson.JsonParseException
- if json is not in the expected format of typeofT
public com.google.gson.JsonElement serialize(ITextComponent p_serialize_1_, java.lang.reflect.Type p_serialize_2_, com.google.gson.JsonSerializationContext p_serialize_3_)
com.google.gson.JsonSerializer
In the implementation of this call-back method, you should consider invoking
JsonSerializationContext.serialize(Object, Type)
method to create JsonElements for any
non-trivial field of the src
object. However, you should never invoke it on the
src
object itself since that will cause an infinite loop (Gson will call your
call-back method again).
serialize
インタフェース内 com.google.gson.JsonSerializer<ITextComponent>
p_serialize_1_
- the object that needs to be converted to Json.p_serialize_2_
- the actual type (fully genericized version) of the source object.public static java.lang.String toJson(ITextComponent component)
public static com.google.gson.JsonElement toJsonTree(ITextComponent p_200528_0_)
@Nullable public static ITextComponent fromJson(java.lang.String json)
ITextComponent
, with strict parsing.fromJsonLenient(String)
,
com.google.gson.stream.JsonReader#setLenient(boolean)}
@Nullable public static ITextComponent fromJson(com.google.gson.JsonElement p_197672_0_)
@Nullable public static ITextComponent fromJsonLenient(java.lang.String json)
ITextComponent
, being lenient upon parse errors.#jsonToComponent(String)
,
com.google.gson.stream.JsonReader#setLenient(boolean)}
public static ITextComponent fromJson(com.mojang.brigadier.StringReader p_197671_0_)