Class DefaultConfigParser

java.lang.Object
com.ultikits.ultitools.interfaces.impl.pasers.ConfigParser<Object>
com.ultikits.ultitools.interfaces.impl.pasers.DefaultConfigParser
All Implemented Interfaces:
ObjectConfigSerializer<Object>, Parser<Object>

@Deprecated(since="6.3.0", forRemoval=true) public class DefaultConfigParser extends ConfigParser<Object>
Deprecated, for removal: This API element is subject to removal in a future version.
Use ConfigConverter and ConfigConverterFor; removed in the next version.
Legacy configuration parser; executable behavior remains unchanged.
Scheduled removal version:
6.4.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    parse(Object object)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Parses a raw object into the target type.
    org.bukkit.configuration.MemorySection
    Deprecated, for removal: This API element is subject to removal in a future version.
    Serializes object into a MemorySection.

    Methods inherited from class com.ultikits.ultitools.interfaces.impl.pasers.ConfigParser

    serialize

    Methods inherited from class java.lang.Object

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

    • DefaultConfigParser

      public DefaultConfigParser()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • parse

      public Object parse(Object object)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: Parser
      Parses a raw object into the target type.
      Parameters:
      object - the raw object to parse (typically from configuration)
      Returns:
      the parsed object of type T
    • serializeToMemorySection

      public org.bukkit.configuration.MemorySection serializeToMemorySection(Object object)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Serializes object into a MemorySection.

      Map and Collection values are walked by their own entries/elements rather than reflected on: a Map/Collection instance's own fields are a JDK implementation detail (e.g. LinkedHashMap's table/head/ tail/modCount), and reflecting on them is wrong even where setAccessible succeeds - it would persist the container's internal bookkeeping instead of its actual contents. On Java 16+ it additionally throws InaccessibleObjectException the first time it tries to open a private java.util field (e.g. LinkedHashMap#serialVersionUID), because java.base does not open java.util to an unnamed module.

      Everything else falls back to the pre-existing reflective walk of the object's own fields, skipping static, transient, and synthetic fields: static fields (like the JDK's own serialVersionUID) are never per-instance state, transient fields are the field author's own "do not persist this" signal, and synthetic fields are compiler-generated bookkeeping (e.g. outer-class references) with no meaningful config representation.

      Parameters:
      object - the object to serialize
      Returns:
      the populated MemorySection