Class GuiComponentDeserializer<C extends GuiComponent,B extends GuiComponentBuilder>
java.lang.Object
com.fasterxml.jackson.databind.JsonDeserializer<C>
io.github.toberocat.guiengine.xml.GuiComponentDeserializer<C,B>
- Type Parameters:
C
- The type ofGuiComponent
to be deserialized.B
- The type ofGuiComponentBuilder
associated with the component to be deserialized.Created: 10.07.2023 Author: Tobias Madlberger (Tobias)
- All Implemented Interfaces:
com.fasterxml.jackson.databind.deser.NullValueProvider
public class GuiComponentDeserializer<C extends GuiComponent,B extends GuiComponentBuilder>
extends com.fasterxml.jackson.databind.JsonDeserializer<C>
Custom JSON deserializer for a specific type of
GuiComponent
.
This class is responsible for deserializing JSON data into a GuiComponent
object using its builder.-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonDeserializer
com.fasterxml.jackson.databind.JsonDeserializer.None
-
Constructor Summary
ConstructorsConstructorDescriptionGuiComponentDeserializer
(@NotNull Class<B> builderClazz) Constructor for the GuiComponentDeserializer. -
Method Summary
Modifier and TypeMethodDescriptiondeserialize
(@NotNull com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext deserializationContext) Deserialize JSON data into aGuiComponent
object using its builder.Methods inherited from class com.fasterxml.jackson.databind.JsonDeserializer
deserialize, deserializeWithType, deserializeWithType, findBackReference, getAbsentValue, getDelegatee, getEmptyAccessPattern, getEmptyValue, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getNullValue, getObjectIdReader, handledType, isCachable, logicalType, replaceDelegatee, supportsUpdate, unwrappingDeserializer
-
Constructor Details
-
GuiComponentDeserializer
Constructor for the GuiComponentDeserializer.- Parameters:
builderClazz
- The class of theGuiComponentBuilder
associated with the component to be deserialized.
-
-
Method Details
-
deserialize
@NotNull public C deserialize(@NotNull @NotNull com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext deserializationContext) throws IOException Deserialize JSON data into aGuiComponent
object using its builder.- Specified by:
deserialize
in classcom.fasterxml.jackson.databind.JsonDeserializer<C extends GuiComponent>
- Parameters:
p
- TheJsonParser
to read the JSON data from.deserializationContext
- TheDeserializationContext
to use during deserialization.- Returns:
- A
GuiComponent
object created from the JSON data using its builder. - Throws:
IOException
- If an I/O error occurs during JSON parsing.
-