Config instances.
See also ConfigValueFactory which contains static methods for
converting Java values into a ConfigObject. You can then convert a
ConfigObject into a Config with ConfigObject#toConfig.
The static methods with "load" in the name do some sort of higher-level
operation potentially parsing multiple resources and resolving substitutions,
while the ones with "parse" in the name just create a ConfigValue
from a resource and nothing else.
You can find an example app and library on GitHub. Also be sure to read the package overview which describes the big picture as shown in those examples.
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static ClassLoader | |
| public static Config | Returns: the default application.conf or system-property-configured configurationObtains the default application-specific configuration,
which defaults to parsing |
| public static Config | Returns: the default application configurationclass loader to look for resources in loader)Like |
| public static Config | Returns: the default application configurationthe options options)Like |
| public static Config | Returns: the default override configurationObtains the default override configuration, which currently consists of system properties. |
| public static Config | Returns: the default override configurationclass loader to look for resources in loader)Like |
| public static Config | Returns: the default reference config for context class loaderObtains the default reference configuration, which is currently created by merging all resources "reference.conf" found on the classpath and overriding the result with system properties. |
| public static Config | Returns: the default reference config for this class loaderclass loader to look for resources in loader)Like |
| public static Config | Returns: the unresolved default reference config for the context class loaderObtains the default reference configuration, which is currently created by merging all resources "reference.conf" found on the classpath and overriding the result with system properties. |
| public static Config | Returns: the unresolved default reference config for this class loaderclass loader to look for resources in loader)Like |
| public static Config | |
| public static Config | Returns: an empty configurationdescription of the config originDescription)Gets an empty configuration with a description to be used to create a
|
| private static ConfigParseOptions | |
| private static ConfigLoadingStrategy | |
| private static Boolean | |
| public static void | |
| public static Config | Returns: configuration for an application relative to context class loadername (optionally without extension) of a resource on classpath resourceBasename)Loads an application's configuration from the given classpath resource or classpath resource basename, sandwiches it between default reference config and default overrides, and then resolves it. |
| public static Config | Returns: configuration for an application relative to given class loaderclass loader to look for resources in loader, String basename (no .conf/.json/.properties suffix) resourceBasename)Like |
| public static Config | Returns: configuration for an applicationthe classpath resource name with optional extension resourceBasename, ConfigParseOptions options to use when parsing the resource parseOptions, ConfigResolveOptions options to use when resolving the stack resolveOptions)Like |
| public static Config | Returns: configuration for an applicationclass loader in which to find resources (overrides loader in
parse options) loader, String the classpath resource name with optional extension resourceBasename, ConfigParseOptions options to use when parsing the resource (class loader
overridden) parseOptions, ConfigResolveOptions options to use when resolving the stack resolveOptions)Like |
| public static Config | |
| public static Config | Returns: resolved configuration with overrides and fallbacks addedthe class loader to use to find resources loader, Config the application's portion of the configuration config)Like |
| public static Config | Returns: resolved configuration with overrides and fallbacks addedthe application's portion of the configuration config, ConfigResolveOptions options for resolving the assembled config stack resolveOptions)Like |
| public static Config | Returns: resolved configuration with overrides and fallbacks addedclass loader to use when looking up override and reference
configs loader, Config the application's portion of the configuration config, ConfigResolveOptions options for resolving the assembled config stack resolveOptions)Like |
| public static Config | Returns: configuration for an applicationLoads a default configuration, equivalent to |
| public static Config | Returns: configuration for an applicationOptions for parsing resources parseOptions)Like |
| public static Config | Returns: configuration for an applicationclass loader for finding resources loader)Like |
| public static Config | Returns: configuration for an applicationclass loader for finding resources (overrides any loader in parseOptions) loader, ConfigParseOptions Options for parsing resources parseOptions)Like |
| public static Config | Returns: configuration for an applicationclass loader for finding resources loader, ConfigResolveOptions options for resolving the assembled config stack resolveOptions)Like |
| public static Config | Returns: configuration for an applicationclass loader for finding resources (overrides any loader in parseOptions) loader, ConfigParseOptions Options for parsing resources parseOptions, ConfigResolveOptions options for resolving the assembled config stack resolveOptions)Like |
| public static Config | Returns: configuration for an applicationOptions for parsing resources parseOptions, final ConfigResolveOptions options for resolving the assembled config stack resolveOptions)Like |
| public static Optional | Returns: ajava. containing any specified replacement, or Optional#empty()
if none was specified.Parse only any application replacement (specified by one of config.{resource,file,url}), returning an empty Config if no overrides were set. |
| public static Optional | Returns: ajava. containing any specified replacement, or Optional#empty()
if none was specified.the class loader loader)Like |
| public static Optional | Returns: ajava. containing any specified replacement, or Optional#empty()
if none was specified.parse options parseOptions)Like |
| public static Config | Returns: the parsed configurationthe file to parse file, ConfigParseOptions parse options to control how the file is interpreted options)Parses a file into a Config instance. |
| public static Config | Returns: the parsed configurationthe file to parse file)Parses a file into a Config instance as with
|
| public static Config | Returns: the parsed configurationa filename with or without extension fileBasename, ConfigParseOptions parse options options)Parses a file with a flexible extension. |
| public static Config | Returns: the parsed configurationa filename with or without extension fileBasename)Like |
| public static Config | Returns: the map converted to aConfigmap from paths to plain Java objects values, String description of what this map represents, like a filename, or
"default settings" (origin description is used in error
messages) originDescription)Creates a |
| public static Config | Returns: the map converted to aConfigmap from paths to plain Java values values)See the other overload of |
| public static Config | Returns: the parsed configurationa Java Properties object properties, ConfigParseOptions the parse options options)Converts a Java |
| public static Config | Returns: the parsed configurationa Java Properties object properties)Like |
| public static Config | Returns: the parsed configurationthe reader to parse reader, ConfigParseOptions parse options to control how the reader is interpreted options)Parses a Reader into a Config instance. |
| public static Config | Returns: the parsed configurationthe reader to parse reader)Parses a reader into a Config instance as with
|
| public static Config | Returns: the parsed configurationklass.getClassLoader() will be used to load
resources, and non-absolute resource names will have this
class's package addedresource to look up, relative to resource, ConfigParseOptions klass's package
or absolute starting with a "/"parse options options)Parses all resources on the classpath with the given name and merges them
into a single |
| public static Config | Returns: the parsed configurationklass.getClassLoader() will be used to load
resources, and non-absolute resource names will have this
class's package addedresource to look up, relative to resource)klass's package
or absolute starting with a "/"Like |
| public static Config | Returns: the parsed configurationwill be used to load resources by setting this loader on the
provided options loader, String resource to look up resource, ConfigParseOptions parse options (class loader is ignored) options)Parses all resources on the classpath with the given name and merges them
into a single |
| public static Config | Returns: the parsed configurationwill be used to load resources loader, String resource to look up in the loader resource)Like |
| public static Config | Returns: the parsed configurationthe resource name resource, ConfigParseOptions parse options options)Like |
| public static Config | Returns: the parsed configurationthe resource name resource)Like |
| public static Config | Returns: the parsed configurationclass which determines the klass, String ClassLoader and the
package for relative resource namesa resource name as in resourceBasename, ConfigParseOptions java.,
with or without extensionparse options (class loader is ignored in favor of the one
from klass) options)Parses classpath resources with a flexible extension. |
| public static Config | Returns: the parsed configurationklass.getClassLoader() will be used to load
resources, and non-absolute resource names will have this
class's package addeda resource name as in resourceBasename)java.,
with or without extensionLike |
| public static Config | Returns: the parsed configurationclass loader to look up resources in, will be set on options loader, String a resource name as in
resourceBasename, ConfigParseOptions java., with or without
extensionparse options (class loader ignored) options)Parses classpath resources with a flexible extension. |
| public static Config | Returns: the parsed configurationwill be used to load resources loader, String a resource name as in
resourceBasename)java., with or without
extensionLike |
| public static Config | Returns: the parsed configurationthe resource basename (no file type suffix) resourceBasename, ConfigParseOptions parse options options)Like
|
| public static Config | Returns: the parsed configurationthe resource basename (no file type suffix) resourceBasename)Like |
| public static Config | Returns: the parsed configurationstring to parse s, ConfigParseOptions parse options options)Parses a string (which should be valid HOCON or JSON by default, or the syntax specified in the options otherwise). |
| public static Config | Returns: the parsed configurationstring to parse s)Parses a string (which should be valid HOCON or JSON). |
| public static Config | Returns: the parsed configurationthe url to parse url, ConfigParseOptions parse options to control how the url is interpreted options)Parses a URL into a Config instance. |
| public static Config | Returns: the parsed configurationthe url to parse url)Parses a url into a Config instance as with
|
| public static Config | Returns: system environment variables parsed into aConfigGets a |
| public static Config | Returns: system environment variable overrides parsed into aConfigGets a |
| public static Config | Returns: system properties parsed into aConfigGets a |