Class GuiComponentSerializer<C extends GuiComponent>

java.lang.Object
com.fasterxml.jackson.databind.JsonSerializer<T>
com.fasterxml.jackson.databind.ser.std.StdSerializer<C>
io.github.toberocat.guiengine.xml.GuiComponentSerializer<C>
Type Parameters:
C - The type of GuiComponent to be serialized.

Created: 10.07.2023 Author: Tobias Madlberger (Tobias)

All Implemented Interfaces:
com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable, com.fasterxml.jackson.databind.jsonschema.SchemaAware, Serializable

public class GuiComponentSerializer<C extends GuiComponent> extends com.fasterxml.jackson.databind.ser.std.StdSerializer<C>
Custom JSON serializer for a specific type of GuiComponent. This class is responsible for serializing a GuiComponent object to JSON.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonSerializer

    com.fasterxml.jackson.databind.JsonSerializer.None
  • Field Summary

    Fields inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer

    _handledType
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for the GuiComponentSerializer.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    serialize(C c, @NotNull com.fasterxml.jackson.core.JsonGenerator jsonGenerator, @NotNull com.fasterxml.jackson.databind.SerializerProvider serializerProvider)
    Serialize a GuiComponent object to JSON.

    Methods inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer

    _neitherNull, _nonEmpty, acceptJsonFormatVisitor, createSchemaNode, createSchemaNode, findAnnotatedContentSerializer, findContextualConvertingSerializer, findConvertingContentSerializer, findFormatFeature, findFormatOverrides, findIncludeOverrides, findPropertyFilter, getSchema, getSchema, handledType, isDefaultSerializer, visitArrayFormat, visitArrayFormat, visitFloatFormat, visitIntFormat, visitIntFormat, visitStringFormat, visitStringFormat, wrapAndThrow, wrapAndThrow

    Methods inherited from class com.fasterxml.jackson.databind.JsonSerializer

    getDelegatee, isEmpty, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, serializeWithType, unwrappingSerializer, usesObjectId, withFilterId

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GuiComponentSerializer

      public GuiComponentSerializer(Class<C> t)
      Constructor for the GuiComponentSerializer.
      Parameters:
      t - The class of the GuiComponent to be serialized.
  • Method Details

    • serialize

      public void serialize(@NotNull C c, @NotNull @NotNull com.fasterxml.jackson.core.JsonGenerator jsonGenerator, @NotNull @NotNull com.fasterxml.jackson.databind.SerializerProvider serializerProvider) throws IOException
      Serialize a GuiComponent object to JSON.
      Specified by:
      serialize in class com.fasterxml.jackson.databind.ser.std.StdSerializer<C extends GuiComponent>
      Parameters:
      c - The GuiComponent object to be serialized.
      jsonGenerator - The JsonGenerator to write the JSON data to.
      serializerProvider - The SerializerProvider to use during serialization.
      Throws:
      IOException - If an I/O error occurs during JSON generation.