Class EngineConfigAdapter

java.lang.Object
com.blackrook.engine.adapter.EngineConfigAdapter
All Implemented Interfaces:
EngineConfig

public class EngineConfigAdapter extends Object implements EngineConfig
Adapter class for engine configs. Without overriding, this config does the following:
  • Application name is null.
  • Application version is null.
  • Application icon is null.
  • Application support E-mail is null.
  • Application contact E-mail is null.
  • Application support homepage is null.
  • Application support page is null.
  • Package roots is empty.
  • Startup component class list is empty.
  • Global setting path is empty.
  • User setting path is empty.
  • Global variables file path is empty.
  • User variables file path is empty.
  • Log file path is empty.
  • Log level is INFO.
  • File system stack is empty.
  • File system archive list is empty.
  • File system archive extension autoload is empty.
  • Resource definition file is empty.
  • Updates per second is null (no ticker).
  • Debug mode is false.
  • List of console commands to execute is empty.
Author:
Matthew Tropiano
  • Constructor Details

    • EngineConfigAdapter

      public EngineConfigAdapter()
  • Method Details

    • getApplicationName

      public String getApplicationName()
      Specified by:
      getApplicationName in interface EngineConfig
      Returns:
      the application name. Can be null.
    • getApplicationVersion

      public String getApplicationVersion()
      Specified by:
      getApplicationVersion in interface EngineConfig
      Returns:
      the application version string. Can be null.
    • getApplicationIcon

      public Image getApplicationIcon()
      Specified by:
      getApplicationIcon in interface EngineConfig
      Returns:
      the icon used for the application. Can be null.
    • getApplicationSupportEmail

      public String getApplicationSupportEmail()
      Specified by:
      getApplicationSupportEmail in interface EngineConfig
      Returns:
      the e-mail address used for support. Can be null.
    • getApplicationContactEmail

      public String getApplicationContactEmail()
      Specified by:
      getApplicationContactEmail in interface EngineConfig
      Returns:
      the e-mail address used for general contact. Can be null.
    • getApplicationHomepage

      public String getApplicationHomepage()
      Specified by:
      getApplicationHomepage in interface EngineConfig
      Returns:
      the URL for the application homepage. Can be null.
    • getApplicationSupportPage

      public String getApplicationSupportPage()
      Specified by:
      getApplicationSupportPage in interface EngineConfig
      Returns:
      the e-mail address used for general contact. Can be null.
    • getPackageRoots

      public String[] getPackageRoots()
      Specified by:
      getPackageRoots in interface EngineConfig
      Returns:
      the package root name for scanning stuff in the engine application classpath.
    • getStartupComponentClasses

      public String[] getStartupComponentClasses()
      Description copied from interface: EngineConfig
      Gets the list of singleton classes that should be instantiated on startup. Their dependencies are also loaded. All names do not need full qualification. If null, all classes are loaded.
      Specified by:
      getStartupComponentClasses in interface EngineConfig
      Returns:
      an array of singleton classes to load.
    • getGlobalSettingsPath

      public String getGlobalSettingsPath()
      Description copied from interface: EngineConfig
      Returns the directory path for storing global configuration. NOTE: This is OUTSIDE of the file system path.
      Specified by:
      getGlobalSettingsPath in interface EngineConfig
      Returns:
      the global settings path root.
    • getUserSettingsPath

      public String getUserSettingsPath()
      Description copied from interface: EngineConfig
      Returns the directory path for storing user configuration. NOTE: This is OUTSIDE of the file system path.
      Specified by:
      getUserSettingsPath in interface EngineConfig
      Returns:
      the user settings path root.
    • getGlobalVariablesFile

      public String getGlobalVariablesFile()
      Description copied from interface: EngineConfig
      Returns the file off of the global directory path for storing/reading archived variables. If null, saves/reads nothing.
      Specified by:
      getGlobalVariablesFile in interface EngineConfig
      Returns:
      the filename to store global variables in.
      See Also:
    • getUserVariablesFile

      public String getUserVariablesFile()
      Description copied from interface: EngineConfig
      Returns the file off of the user directory path for storing/reading archived variables. If null, saves/reads nothing.
      Specified by:
      getUserVariablesFile in interface EngineConfig
      Returns:
      the filename to store user variables in.
      See Also:
    • getLogFile

      public String getLogFile()
      Description copied from interface: EngineConfig
      Returns the file to log console output to (other than the console itself). NOTE: This is OUTSIDE of the file system path.
      Specified by:
      getLogFile in interface EngineConfig
      Returns:
      the filename of the log.
    • getLogLevel

      public EngineLoggingFactory.LogLevel getLogLevel()
      Specified by:
      getLogLevel in interface EngineConfig
      Returns:
      the base logging level for the logging factory.
    • getFileSystemStack

      public String[] getFileSystemStack()
      Description copied from interface: EngineConfig
      Gets the list of directory paths to add in lowest to greatest stack precedence. If empty, these directories are not added. This is consulted if EngineConfig.getFileSystemArchives() returns an empty value.
      Specified by:
      getFileSystemStack in interface EngineConfig
      Returns:
      the paths to push onto the filesystem stack.
      See Also:
    • getFileSystemArchives

      public String[] getFileSystemArchives()
      Description copied from interface: EngineConfig
      Gets the file system archives to mount. Files are considered to be ZIP formatted. If null, does not load specific archive types. Archives are loaded in order specified in the array. NOTE: If this is not empty, loading via FileSystemStack is ignored.
      Specified by:
      getFileSystemArchives in interface EngineConfig
      Returns:
      the array of archive paths off of the mounted filesystem.
      See Also:
    • getFileSystemStackArchiveAutoloadExtension

      public String getFileSystemStackArchiveAutoloadExtension()
      Description copied from interface: EngineConfig
      Gets the file system extension for archive types to mount. Files are considered to be ZIP formatted. If empty, does not auto-load archive types. Archives are loaded in lexicographical order.
      Specified by:
      getFileSystemStackArchiveAutoloadExtension in interface EngineConfig
      Returns:
      the archive file extension or null to not auto-load archives.
      See Also:
    • getUpdatesPerSecond

      public Integer getUpdatesPerSecond()
      Description copied from interface: EngineConfig
      Gets how many updates per second that the main updating thread needs to do. If the returned value is 0 or less, this runs full bore. If this returns null the updater is not started.
      Specified by:
      getUpdatesPerSecond in interface EngineConfig
      Returns:
      the updates per second of the main ticker.
    • getDebugMode

      public boolean getDebugMode()
      Specified by:
      getDebugMode in interface EngineConfig
      Returns:
      if this Engine should start in debug mode.
    • getConsoleCommandsToExecute

      public String[] getConsoleCommandsToExecute()
      Description copied from interface: EngineConfig
      Gets the list of console commands to execute after startup. If empty, nothing happens.
      Specified by:
      getConsoleCommandsToExecute in interface EngineConfig
      Returns:
      a list of console commands to execute after startup.