abstract class ConfigLoader extends Logging
ConfigLoader loads configurations by using typesafe.com's config library.
You should set the application environment, then ConfigLoad will read the configuration
file [app_env].conf
in your resources directory.
Multiple solutions are possible to configure application environment:
-
Otherwise you can set the JVM property app.environment
. For example, by adding -Dapp.environment=local
in your command,
ConfigLoader will read the conf file local.conf
-
You can also create app.environment
in the default configuration file (example: application.conf,
application.properties)
- The last solution is to overwrite directly the value of
confPath
with the name of you configuration file. Then ConfigLoader will read directly the given file
The priority of the above solution is:
configPath >> setAppEnv >> JVM property >> `app.environment` in default config file
If none of the above parameters are set, ConfigLoader will try to read its fallback configuration file
- Annotations
- @Evolving()
- Alphabetic
- By Inheritance
- ConfigLoader
- Logging
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new ConfigLoader()
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def appEnv: String
- val appName: String
-
var
applicationEnvironment: Option[String]
- Attributes
- protected
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
beforeAll(): Unit
BeforeAll will be called before loading the typesafe config file.
BeforeAll will be called before loading the typesafe config file. User can override it with property settings
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
lazy val
config: Config
Config loaded from filesystem
- val configPath: Option[String]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
get(key: String): String
Get the value of a key
Get the value of a key
- key
path expression
- returns
the string value at the requested path
- Exceptions thrown
ConfigException.Missing
if value is absent or nullConfigException.WrongType
if value is not convertible to an Enum
- def getAppEnvFromJvmProperties: Option[String]
-
def
getArray(key: String): Array[String]
Get the value of a key
Get the value of a key
- key
path expression
- returns
the Array[String] value at the requested path
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getConfig(key: String): Config
Get the value of a key
Get the value of a key
- key
path expression
- returns
the nested Config value at the requested path
- def getConfigPath: String
-
def
getObject(key: String): ConfigObject
Get the value of a key
Get the value of a key
- key
path expression
- returns
the ConfigObject value at the requested path
-
def
getOption(key: String): Option[String]
Get the value of a key
Get the value of a key
- key
path expression
- returns
Option[String] if the key exists, None otherwise
-
def
has(key: String): Boolean
Check if a key is presented in a config
Check if a key is presented in a config
- key
path expression
- returns
true if the config contains the key, otherwise false
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
log: Logger
- Attributes
- protected
- Definition Classes
- Logging
-
def
logDebug(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logError(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logInfo(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logName: String
- Attributes
- protected
- Definition Classes
- Logging
-
def
logTrace(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
def
logWarning(msg: ⇒ String): Unit
- Attributes
- protected
- Definition Classes
- Logging
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()