Class ConfigurationSystem


  • public class ConfigurationSystem
    extends java.lang.Object
    The system's main class used for management. Every JSON file should have an instance of this, and JSON files can have unlimited options/option classes.
    • Constructor Summary

      Constructors 
      Constructor Description
      ConfigurationSystem​(java.io.File file)
      Creates a new instance of the configuration handler.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.google.gson.JsonObject getJsonObject()
      Get the JSON object for this instance of the system's file.
      void register​(java.lang.Object config)
      Registers a class and all the Options it contains to the current JSON file.
      void save()
      Saves the configuration to the file assigned to this handler.
      void unregister​(java.lang.Object config)
      Removes a class and any option it contains from this handler.
      • Methods inherited from class java.lang.Object

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

      • ConfigurationSystem

        public ConfigurationSystem​(java.io.File file)
        Creates a new instance of the configuration handler.
        Parameters:
        file - The file that the configuration should be saved/loaded from.
    • Method Detail

      • getJsonObject

        public com.google.gson.JsonObject getJsonObject()
        Get the JSON object for this instance of the system's file.
        Returns:
        The JsonObject instance.
      • register

        public void register​(java.lang.Object config)
        Registers a class and all the Options it contains to the current JSON file.
        Parameters:
        config - The class to be registered.
      • unregister

        public void unregister​(java.lang.Object config)
        Removes a class and any option it contains from this handler. This may cause changes to be discarded!
        Parameters:
        config - The class to unregister.
      • save

        public void save()
        Saves the configuration to the file assigned to this handler.