me.jacklin213.lincore
Class LocalConfigHandler

java.lang.Object
  extended by me.jacklin213.lincore.LocalConfigHandler

public class LocalConfigHandler
extends Object

LocalConfigHandler is a class which handles basic configuration. If addition methods need to be added make a local class which extends to this class.

Author:
jacklin213

Field Summary
static LinCore LinCore
           
 
Constructor Summary
LocalConfigHandler(Plugin instance, Logger logger, DataStorage dataStorage)
          LocalConfigHandler constructor for LinPlugin series.
 
Method Summary
 void assignVariableStrings()
          Assigns the Strings to their specified variables in the DataStorage class
 void createConfig()
          Creates a config which is copied from the default config.yml, will cause and NPE if there is no default config
 FileConfiguration getConfig()
          Gets the config
 Logger getConfigLogger()
          Returns the plugin logger.
 String getPluginFolder()
          Gets the absolute path of the plugin datafolder.
 void reloadConfig()
          Reloads the config and logs message to console
 void setConfig()
          Sets the config from the plugin class.
 void setConfigLogger()
          Sets the logger form the plugin class.
 void setDataStorageClass(DataStorage instance)
          Sets the instance of the DataStorage class for the ConfigHandler class.
 void setPluginDescriptionFile()
          Sets the PluginDesciptionFile.
 void setPluginFolder()
          Sets the pluginFolder.
 void setup()
          Sets up the ConfigHandler for specified LinPlugin from the LocalConfigHandler constructor Runs the register, setPluginFolder, setConfigLogger, createConfig methods.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LinCore

public static LinCore LinCore
Constructor Detail

LocalConfigHandler

public LocalConfigHandler(Plugin instance,
                          Logger logger,
                          DataStorage dataStorage)
LocalConfigHandler constructor for LinPlugin series. Runs the setup method

Parameters:
instance - The LinPlugin to be hooked to.
logger - Plugin logger (getLogger() from main class)
dataStorage - DataStorage instance to set and retrieve data from
Method Detail

createConfig

public void createConfig()
Creates a config which is copied from the default config.yml, will cause and NPE if there is no default config


reloadConfig

public void reloadConfig()
Reloads the config and logs message to console


setup

public void setup()
Sets up the ConfigHandler for specified LinPlugin from the LocalConfigHandler constructor Runs the register, setPluginFolder, setConfigLogger, createConfig methods.


getConfig

public FileConfiguration getConfig()
Gets the config

Returns:
FileConfiguration config

getConfigLogger

public Logger getConfigLogger()
Returns the plugin logger.

Returns:
Logger log

getPluginFolder

public String getPluginFolder()
Gets the absolute path of the plugin datafolder.

Returns:
String dataFolder

setConfig

public void setConfig()
Sets the config from the plugin class.


setConfigLogger

public void setConfigLogger()
Sets the logger form the plugin class.


setDataStorageClass

public void setDataStorageClass(DataStorage instance)
Sets the instance of the DataStorage class for the ConfigHandler class.

Parameters:
instance - DataStorage instance (Should be declared in main class)

setPluginDescriptionFile

public void setPluginDescriptionFile()
Sets the PluginDesciptionFile.


setPluginFolder

public void setPluginFolder()
Sets the pluginFolder.


assignVariableStrings

public void assignVariableStrings()
Assigns the Strings to their specified variables in the DataStorage class