Package net.minecraft.util
Class JsonSerializing.TypeHandler<E,T extends JsonSerializableType<E>>
java.lang.Object
net.minecraft.util.JsonSerializing.TypeHandler<E,T>
- Enclosing class:
- JsonSerializing
public static class JsonSerializing.TypeHandler<E,T extends JsonSerializableType<E>> extends Object
A handler of JSON serializable types that can either obtain a type from
a registry to handle JSON conversion or handle with a custom logic bound
to a type.
When the root element read is an object, the handler obtains the type from registry to handle reading; otherwise, it falls back to custom logic.
-
Field Summary
Fields Modifier and Type Field Description private com.mojang.datafixers.util.Pair<T,JsonSerializing.CustomSerializer<? extends E>>
customSerializer
private String
idFieldName
private Registry<T>
registry
private String
rootFieldName
private Function<E,T>
typeIdentification
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description Object
createGsonSerializer()
-
Field Details
-
registry
-
rootFieldName
-
idFieldName
-
typeIdentification
-
customSerializer
@Nullable private com.mojang.datafixers.util.Pair<T extends JsonSerializableType<E>,JsonSerializing.CustomSerializer<? extends E>> customSerializer
-
-
Constructor Details
-
TypeHandler
-
-
Method Details
-
createGsonSerializer
-