commandbox.system.services

Class ConfigService

lucee.Component
    extended by commandbox.system.services.ConfigService

Copyright Since 2014 CommandBox by Ortus Solutions, Corp www.coldbox.org | www.ortussolutions.com I handle working with the CommandBox.json file

Class Attributes:
  • singleton
  •  
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
  • author : Brad Wood, Luis Majano
  •  
    Property Summary
    type property default serializable required
    any JSONService


    • access = public
    • returntype = any
    • inject = JSONService
    true false
    any ModuleService


    • access = public
    • returntype = any
    • inject = ModuleService
    true false
    any ServerService


    • access = public
    • returntype = any
    • inject = ServerService
    true false
    any configFilePath


    • access = public
    • returntype = any
    true false
    any configSettings


    • access = public
    • returntype = any
    true false
    any formatterUtil


    • access = public
    • returntype = any
    • inject = formatter
    true false
    any possibleConfigSettings


    • access = public
    • returntype = any
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    any completeProperty([any all='false'], [any asSet='false'])
         Dynamic completion for property name based on contents of commandbox.
    string getConfigFilePath()
    string getConfigSettings()
    string getFormatterUtil()
    string getJSONService()
    string getModuleService()
    string getPossibleConfigSettings()
    string getServerService()
    any getSetting(any name, [any defaultValue])
         Get a setting from a configuration structure.
    any loadConfig()
         Loads config settings from disk.
    any onDIComplete()
    any removeSetting(any name)
         Remove a value in the application configuration settings.
    any saveConfig()
         Persists config settings to disk.
    any setConfigFilePath(any configFilePath)
    any setConfigSettings(struct configSettings)
    any setFormatterUtil(any formatterUtil)
    any setJSONService(any JSONService)
    any setModuleService(any ModuleService)
    any setPossibleConfigSettings(any possibleConfigSettings)
    any setServerService(any ServerService)
    any setSetting(any name, any value, [boolean thisAppend='false'])
         Set a value in the application configuration settings.
    boolean settingExists(any name)
         Check if a value exists in a configuration structure.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init()

    Constructor


    Property Detail

    JSONService

    property any JSONService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - JSONService
    serializable - true

    ModuleService

    property any ModuleService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - ModuleService
    serializable - true

    ServerService

    property any ServerService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - ServerService
    serializable - true

    configFilePath

    property any configFilePath

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    configSettings

    property any configSettings

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    formatterUtil

    property any formatterUtil

    Attributes:
    access - public
    required - false
    returntype - any
    inject - formatter
    serializable - true

    possibleConfigSettings

    property any possibleConfigSettings

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    Method Detail

    completeProperty

    public any completeProperty([any all='false'], [any asSet='false'])

    Dynamic completion for property name based on contents of commandbox.json

    Parameters:
    all - Pass false to ONLY suggest existing setting names. True will suggest all possible settings.
    asSet - Pass true to add = to the end of the options

    getConfigFilePath

    public string getConfigFilePath()


    getConfigSettings

    public string getConfigSettings()


    getFormatterUtil

    public string getFormatterUtil()


    getJSONService

    public string getJSONService()


    getModuleService

    public string getModuleService()


    getPossibleConfigSettings

    public string getPossibleConfigSettings()


    getServerService

    public string getServerService()


    getSetting

    public any getSetting(any name, [any defaultValue])

    Get a setting from a configuration structure

    Parameters:
    name - The name of the setting. Allows for "deep" struct/array names.
    defaultValue - The default value to use if setting does not exist

    loadConfig

    public any loadConfig()

    Loads config settings from disk


    onDIComplete

    public any onDIComplete()


    removeSetting

    public any removeSetting(any name)

    Remove a value in the application configuration settings

    Parameters:
    name - The name of the setting. Allows for "deep" struct/array names.

    saveConfig

    public any saveConfig()

    Persists config settings to disk


    setConfigFilePath

    public any setConfigFilePath(any configFilePath)

    Parameters:
    configFilePath

    setConfigSettings

    public any setConfigSettings(struct configSettings)

    Parameters:
    configSettings

    setFormatterUtil

    public any setFormatterUtil(any formatterUtil)

    Parameters:
    formatterUtil

    setJSONService

    public any setJSONService(any JSONService)

    Parameters:
    JSONService

    setModuleService

    public any setModuleService(any ModuleService)

    Parameters:
    ModuleService

    setPossibleConfigSettings

    public any setPossibleConfigSettings(any possibleConfigSettings)

    Parameters:
    possibleConfigSettings

    setServerService

    public any setServerService(any ServerService)

    Parameters:
    ServerService

    setSetting

    public any setSetting(any name, any value, [boolean thisAppend='false'])

    Set a value in the application configuration settings

    Parameters:
    name - The name of the setting. Allows for "deep" struct/array names.
    value - The value to set
    thisAppend - Append an array or struct to existing

    settingExists

    public boolean settingExists(any name)

    Check if a value exists in a configuration structure

    Parameters:
    name - The name of the setting. Allows for "deep" struct/array names.