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 = provider:ServerService
    true false
    any configFilePath


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


    • 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 interceptorService


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


    • access = public
    • returntype = any
    true false
    boolean serverServiceCompletePerformed


    • access = public
    • returntype = any
    false 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 getConfigSettingOverrides()
    any getConfigSettings([boolean noOverrides='false'])
         Return all config settings including env var/sys prop overrides.
    string getFormatterUtil()
    string getInterceptorService()
    string getJSONService()
    string getModuleService()
    string getPossibleConfigSettings()
    string getServerService()
    string getServerServiceCompletePerformed()
    any getSetting(any name, [any defaultValue])
         Get a setting from a configuration structure.
    any getSettingJMES(any name, [any defaultValue])
         Get a setting from a configuration structure with JMESPath.
    any loadConfig()
         Loads config settings from disk.
    any loadOverrides()
         Loads config settings from env vars or Java system properties.
    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 setConfigSettingOverrides(any configSettingOverrides)
    any setConfigSettings(struct configSettings)
    any setFormatterUtil(any formatterUtil)
    any setInterceptorService(any interceptorService)
    any setJSONService(any JSONService)
    any setModuleService(any ModuleService)
    any setPossibleConfigSettings(any possibleConfigSettings)
    any setServerService(any ServerService)
    any setServerServiceCompletePerformed(boolean serverServiceCompletePerformed)
    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 - provider:ServerService
    serializable - true

    configFilePath

    property any configFilePath

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

    configSettingOverrides

    property any configSettingOverrides

    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

    interceptorService

    property any interceptorService

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

    possibleConfigSettings

    property any possibleConfigSettings

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

    serverServiceCompletePerformed

    property boolean serverServiceCompletePerformed = [false]

    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()


    getConfigSettingOverrides

    public string getConfigSettingOverrides()


    getConfigSettings

    public any getConfigSettings([boolean noOverrides='false'])

    Return all config settings including env var/sys prop overrides

    Parameters:
    noOverrides

    getFormatterUtil

    public string getFormatterUtil()


    getInterceptorService

    public string getInterceptorService()


    getJSONService

    public string getJSONService()


    getModuleService

    public string getModuleService()


    getPossibleConfigSettings

    public string getPossibleConfigSettings()


    getServerService

    public string getServerService()


    getServerServiceCompletePerformed

    public string getServerServiceCompletePerformed()


    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

    getSettingJMES

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

    Get a setting from a configuration structure with JMESPath

    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


    loadOverrides

    public any loadOverrides()

    Loads config settings from env vars or Java system properties


    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

    setConfigSettingOverrides

    public any setConfigSettingOverrides(any configSettingOverrides)

    Parameters:
    configSettingOverrides

    setConfigSettings

    public any setConfigSettings(struct configSettings)

    Parameters:
    configSettings

    setFormatterUtil

    public any setFormatterUtil(any formatterUtil)

    Parameters:
    formatterUtil

    setInterceptorService

    public any setInterceptorService(any interceptorService)

    Parameters:
    interceptorService

    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

    setServerServiceCompletePerformed

    public any setServerServiceCompletePerformed(boolean serverServiceCompletePerformed)

    Parameters:
    serverServiceCompletePerformed

    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.