object ConfigSource
Object containing factory methods for building ConfigSource
s.
The sources provided here use Typesafe Config configs created from files, resources, URLs or strings. It also
provides sources that delegate the loading component to Typesafe Config, to leverage reference configs and
overrides, making it easy to switch from using ConfigFactory
to ConfigSource
.
Other PureConfig modules may provide other ways or building config sources (e.g. for different config formats or data sources).
- Alphabetic
- By Inheritance
- ConfigSource
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def default(appSource: ConfigObjectSource): ConfigObjectSource
A config source for the default loading process in Typesafe Config with a custom application config source.
A config source for the default loading process in Typesafe Config with a custom application config source. Typesafe Config stacks
reference.conf
resources provided by libraries, the given file and system property overrides, resolves them and merges them into a single config.This method is provided here to support use cases that previously depended on
ConfigFactory.load(config)
. Creating a custom source by merging the layers manually is usually recommended as it makes the config priorities more transparent.- appSource
the source providing the application config
- returns
a
ConfigObjectSource
for the default loading process in Typesafe Config with a custom application config source.
- val default: ConfigObjectSource
A config source for the default loading process in Typesafe Config.
A config source for the default loading process in Typesafe Config. Typesafe Config stacks
reference.conf
resources provided by libraries, application configs (by defaultapplication.conf
in resources) and system property overrides, resolves them and merges them into a single config. This source is equivalent todefaultOverrides.withFallback(defaultApplication).withFallback(defaultReference)
. - val defaultApplication: ConfigObjectSource
A config source for the default application config in Typesafe Config (by default
application.conf
in resources).A config source for the default application config in Typesafe Config (by default
application.conf
in resources). Like Typesafe Config, it provides an empty object if application config files are not found. - val defaultOverrides: ConfigObjectSource
A config source for the default overrides in Typesafe Config (by default a map of system properties).
- val defaultReference: ConfigObjectSource
A config source for the default reference config in Typesafe Config (
reference.conf
resources provided by libraries).A config source for the default reference config in Typesafe Config (
reference.conf
resources provided by libraries). Like Typesafe Config, it provides an empty object ifreference.conf
files are not found.As required by the HOCON spec, the default reference files are pre-emptively resolved - substitutions in the reference config aren't affected by application configs.
- val defaultReferenceUnresolved: ConfigObjectSource
A config source for the default reference config in Typesafe Config (
reference.conf
resources provided by libraries) before being resolved.A config source for the default reference config in Typesafe Config (
reference.conf
resources provided by libraries) before being resolved. This can be used as an alternative todefaultReference
for use cases that requirereference.conf
to depend onapplication.conf
. Like Typesafe Config, it provides an empty object ifreference.conf
files are not found. - val empty: ConfigObjectSource
A config source that always provides empty configs.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def file(file: File): ConfigObjectSource
Returns a config source that provides configs read from a file.
Returns a config source that provides configs read from a file.
- file
the file
- returns
a config source that provides configs read from a file.
- def file(path: Path): ConfigObjectSource
Returns a config source that provides configs read from a file.
Returns a config source that provides configs read from a file.
- path
the path to the file
- returns
a config source that provides configs read from a file.
- def file(path: String): ConfigObjectSource
Returns a config source that provides configs read from a file.
Returns a config source that provides configs read from a file.
- path
the path to the file as a string
- returns
a config source that provides configs read from a file.
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def fromConfig(conf: Config): ConfigObjectSource
Returns a config source that provides a fixed
Config
.Returns a config source that provides a fixed
Config
.- conf
the config to be provided
- returns
a config source that provides the given config.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- 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()
- def resources(name: String, classLoader: ClassLoader): ConfigObjectSource
Returns a config source that provides configs read from JVM resource files.
Returns a config source that provides configs read from JVM resource files. If multiple files are found, they are merged in no specific order. The given class loader will be used to look for resources.
- name
the resource name
- classLoader
the class loader to use to look for resources
- returns
a config source that provides configs read from JVM resource files.
- def resources(name: String): ConfigObjectSource
Returns a config source that provides configs read from JVM resource files.
Returns a config source that provides configs read from JVM resource files. If multiple files are found, they are merged in no specific order. This method uses Typesafe Config's default class loader (
Thread.currentThread().getContextClassLoader()
).- name
the resource name
- returns
a config source that provides configs read from JVM resource files.
- def string(confStr: String): ConfigObjectSource
Returns a config source that provides a config parsed from a string.
Returns a config source that provides a config parsed from a string.
- confStr
the config content
- returns
a config source that provides a config parsed from a string.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- val systemProperties: ConfigObjectSource
A config source for Java system properties.
- def toString(): String
- Definition Classes
- AnyRef → Any
- def url(url: URL): ConfigObjectSource
Returns a config source that provides configs read from a URL.
Returns a config source that provides configs read from a URL. The URL can either point to a local file or to a remote HTTP location.
- url
the URL
- returns
a config source that provides configs read from a URL.
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()