Class AutoLoader

java.lang.Object
dev.jaxydog.lodestone.api.AutoLoader
All Implemented Interfaces:
Loaded

public abstract class AutoLoader extends Object implements Loaded
A class that automatically loads all of its registered static constants.

Extending classes should typically be marked as final, and only contain private inner classes and public static final fields. They should always be singletons, with their only instance being loaded either directly during initialization or indirectly through another AutoLoader.

Since:
1.0.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final org.slf4j.Logger
    This loader's logger instance.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Registers all defined values that extend a Loaded interface for future loading.
    <T extends Loaded>
    void
    register(Class<? extends T> type)
    Registers all defined values that extend the given Loaded interface for future loading.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface dev.jaxydog.lodestone.api.Loaded

    getLoaderId
  • Field Details

    • logger

      protected final org.slf4j.Logger logger
      This loader's logger instance.
      Since:
      1.0.0
  • Constructor Details

    • AutoLoader

      public AutoLoader()
  • Method Details

    • register

      public <T extends Loaded> void register(Class<? extends T> type)
      Registers all defined values that extend the given Loaded interface for future loading.
      Type Parameters:
      T - The type of the Loaded interface.
      Parameters:
      type - The type to register.
      Since:
      1.0.0
    • register

      public void register()
      Registers all defined values that extend a Loaded interface for future loading.
      Since:
      1.0.0