Package | Description |
---|---|
com.typesafe.config |
An API for loading and using configuration files, see the project site
for more information.
|
com.typesafe.config.impl |
Internal implementation details that can change ABI at any time.
|
Modifier and Type | Method and Description |
---|---|
Config |
ConfigValue.atKey(String key)
Places the value inside a
Config at the given key. |
Config |
Config.atKey(String key)
Places the config inside a
Config at the given key. |
Config |
ConfigValue.atPath(String path)
Places the value inside a
Config at the given path. |
Config |
Config.atPath(String path)
Places the config inside another
Config at the given path. |
static Config |
ConfigFactory.defaultApplication()
Obtains the default application-specific configuration,
which defaults to parsing
application.conf ,
application.json , and
application.properties on the classpath, but
can also be rerouted using the config.file ,
config.resource , and config.url
system properties. |
static Config |
ConfigFactory.defaultApplication(ClassLoader loader)
Like
ConfigFactory.defaultApplication() but allows you to specify a class loader
to use rather than the current context class loader. |
static Config |
ConfigFactory.defaultApplication(ConfigParseOptions options)
Like
ConfigFactory.defaultApplication() but allows you to specify parse options. |
static Config |
ConfigFactory.defaultOverrides()
Obtains the default override configuration, which currently consists of
system properties.
|
static Config |
ConfigFactory.defaultOverrides(ClassLoader loader)
Like
ConfigFactory.defaultOverrides() but allows you to specify a class loader
to use rather than the current context class loader. |
static Config |
ConfigFactory.defaultReference()
Obtains 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.
|
static Config |
ConfigFactory.defaultReference(ClassLoader loader)
Like
ConfigFactory.defaultReference() but allows you to specify a class loader
to use rather than the current context class loader. |
static Config |
ConfigFactory.empty()
Gets an empty configuration.
|
static Config |
ConfigFactory.empty(String originDescription)
Gets an empty configuration with a description to be used to create a
ConfigOrigin for this Config . |
Config |
Config.getConfig(String path) |
static Config |
ConfigFactory.load()
Loads a default configuration, equivalent to
load(defaultApplication()) in most cases. |
static Config |
ConfigFactory.load(ClassLoader loader)
Like
ConfigFactory.load() but allows specifying a class loader other than the
thread's current context class loader. |
static Config |
ConfigFactory.load(ClassLoader loader,
Config config)
Like
ConfigFactory.load(Config) but allows you to specify
the class loader for looking up resources. |
static Config |
ConfigFactory.load(ClassLoader loader,
Config config,
ConfigResolveOptions resolveOptions)
Like
ConfigFactory.load(Config,ConfigResolveOptions) but allows you to specify
a class loader other than the context class loader. |
static Config |
ConfigFactory.load(ClassLoader loader,
ConfigParseOptions parseOptions)
Like
ConfigFactory.load() but allows specifying a class loader other than the
thread's current context class loader and also specify parse options. |
static Config |
ConfigFactory.load(ClassLoader loader,
ConfigParseOptions parseOptions,
ConfigResolveOptions resolveOptions)
Like
ConfigFactory.load() but allows specifying a class loader other than the
thread's current context class loader, parse options, and resolve options. |
static Config |
ConfigFactory.load(ClassLoader loader,
ConfigResolveOptions resolveOptions)
Like
ConfigFactory.load() but allows specifying a class loader other than the
thread's current context class loader and also specify resolve options. |
static Config |
ConfigFactory.load(ClassLoader loader,
String resourceBasename)
Like
ConfigFactory.load(String) but uses the supplied class loader instead of
the current thread's context class loader. |
static Config |
ConfigFactory.load(ClassLoader loader,
String resourceBasename,
ConfigParseOptions parseOptions,
ConfigResolveOptions resolveOptions)
Like
ConfigFactory.load(String,ConfigParseOptions,ConfigResolveOptions) but
has a class loader parameter that overrides any from the
ConfigParseOptions . |
static Config |
ConfigFactory.load(Config config)
Assembles a standard configuration using a custom
Config
object rather than loading "application.conf". |
static Config |
ConfigFactory.load(Config config,
ConfigResolveOptions resolveOptions)
Like
ConfigFactory.load(Config) but allows you to specify
ConfigResolveOptions . |
static Config |
ConfigFactory.load(ConfigParseOptions parseOptions)
Like
ConfigFactory.load() but allows specifying parse options. |
static Config |
ConfigFactory.load(ConfigParseOptions parseOptions,
ConfigResolveOptions resolveOptions)
Like
ConfigFactory.load() but allows specifying parse options and resolve
options. |
static Config |
ConfigFactory.load(String 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.
|
static Config |
ConfigFactory.load(String resourceBasename,
ConfigParseOptions parseOptions,
ConfigResolveOptions resolveOptions)
Like
ConfigFactory.load(String) but allows you to specify parse and resolve
options. |
static Config |
ConfigFactory.parseFile(File file)
Parses a file into a Config instance as with
ConfigFactory.parseFile(File,ConfigParseOptions) but always uses the
default parse options. |
static Config |
ConfigFactory.parseFile(File file,
ConfigParseOptions options)
Parses a file into a Config instance.
|
static Config |
ConfigFactory.parseFileAnySyntax(File fileBasename)
Like
ConfigFactory.parseFileAnySyntax(File,ConfigParseOptions) but always uses
default parse options. |
static Config |
ConfigFactory.parseFileAnySyntax(File fileBasename,
ConfigParseOptions options)
Parses a file with a flexible extension.
|
static Config |
ConfigFactory.parseMap(Map<String,? extends Object> values)
See the other overload of
ConfigFactory.parseMap(Map, String) for details,
this one just uses a default origin description. |
static Config |
ConfigFactory.parseMap(Map<String,? extends Object> values,
String originDescription)
Creates a
Config based on a Map from paths to
plain Java values. |
static Config |
ConfigFactory.parseProperties(Properties properties)
Like
ConfigFactory.parseProperties(Properties, ConfigParseOptions) but uses default
parse options. |
static Config |
ConfigFactory.parseProperties(Properties properties,
ConfigParseOptions options)
|
static Config |
ConfigFactory.parseReader(Reader reader)
Parses a reader into a Config instance as with
ConfigFactory.parseReader(Reader,ConfigParseOptions) but always uses the
default parse options. |
static Config |
ConfigFactory.parseReader(Reader reader,
ConfigParseOptions options)
Parses a Reader into a Config instance.
|
static Config |
ConfigFactory.parseResources(Class<?> klass,
String resource)
Like
ConfigFactory.parseResources(Class,String,ConfigParseOptions) but always uses
default parse options. |
static Config |
ConfigFactory.parseResources(Class<?> klass,
String resource,
ConfigParseOptions options)
Parses all resources on the classpath with the given name and merges them
into a single
Config . |
static Config |
ConfigFactory.parseResources(ClassLoader loader,
String resource)
Like
ConfigFactory.parseResources(ClassLoader,String,ConfigParseOptions) but always uses
default parse options. |
static Config |
ConfigFactory.parseResources(ClassLoader loader,
String resource,
ConfigParseOptions options)
Parses all resources on the classpath with the given name and merges them
into a single
Config . |
static Config |
ConfigFactory.parseResources(String resource)
Like
ConfigFactory.parseResources(ClassLoader,String) but uses thread's
current context class loader. |
static Config |
ConfigFactory.parseResources(String resource,
ConfigParseOptions options)
Like
ConfigFactory.parseResources(ClassLoader,String,ConfigParseOptions) but
uses thread's current context class loader if none is set in the
ConfigParseOptions. |
static Config |
ConfigFactory.parseResourcesAnySyntax(Class<?> klass,
String resourceBasename)
Like
ConfigFactory.parseResourcesAnySyntax(Class,String,ConfigParseOptions)
but always uses default parse options. |
static Config |
ConfigFactory.parseResourcesAnySyntax(Class<?> klass,
String resourceBasename,
ConfigParseOptions options)
Parses classpath resources with a flexible extension.
|
static Config |
ConfigFactory.parseResourcesAnySyntax(ClassLoader loader,
String resourceBasename)
Like
ConfigFactory.parseResourcesAnySyntax(ClassLoader,String,ConfigParseOptions) but always uses
default parse options. |
static Config |
ConfigFactory.parseResourcesAnySyntax(ClassLoader loader,
String resourceBasename,
ConfigParseOptions options)
Parses classpath resources with a flexible extension.
|
static Config |
ConfigFactory.parseResourcesAnySyntax(String resourceBasename)
Like
ConfigFactory.parseResourcesAnySyntax(ClassLoader,String) but uses
thread's current context class loader. |
static Config |
ConfigFactory.parseResourcesAnySyntax(String resourceBasename,
ConfigParseOptions options)
Like
ConfigFactory.parseResourcesAnySyntax(ClassLoader,String,ConfigParseOptions)
but uses thread's current context class loader. |
static Config |
ConfigFactory.parseString(String s)
Parses a string (which should be valid HOCON or JSON).
|
static Config |
ConfigFactory.parseString(String s,
ConfigParseOptions options)
Parses a string (which should be valid HOCON or JSON by default, or
the syntax specified in the options otherwise).
|
static Config |
ConfigFactory.parseURL(URL url)
Parses a url into a Config instance as with
ConfigFactory.parseURL(URL,ConfigParseOptions) but always uses the
default parse options. |
static Config |
ConfigFactory.parseURL(URL url,
ConfigParseOptions options)
Parses a URL into a Config instance.
|
Config |
Config.resolve()
Returns a replacement config with all substitutions (the
${foo.bar} syntax, see the
spec) resolved. |
Config |
Config.resolve(ConfigResolveOptions options)
Like
resolve() but allows you to specify non-default
options. |
Config |
Config.resolveWith(Config source)
Like
resolve() except that substitution values are looked
up in the given source, rather than in this instance. |
Config |
Config.resolveWith(Config source,
ConfigResolveOptions options)
Like
resolveWith(Config) but allows you to specify
non-default options. |
static Config |
ConfigFactory.systemEnvironment()
Gets a
Config containing the system's environment variables. |
static Config |
ConfigFactory.systemProperties()
Gets a
Config containing the system properties from
System.getProperties() , parsed and converted as with
ConfigFactory.parseProperties(java.util.Properties, com.typesafe.config.ConfigParseOptions) . |
Config |
ConfigObject.toConfig()
Converts this object to a
Config instance, enabling you to use
path expressions to find values in the object. |
Config |
Config.withFallback(ConfigMergeable other) |
Config |
Config.withOnlyPath(String path)
Clone the config with only the given path (and its children) retained;
all sibling paths are removed.
|
Config |
Config.withoutPath(String path)
Clone the config with the given path removed.
|
Config |
Config.withValue(String path,
ConfigValue value)
Returns a
Config based on this one, but with the given path set
to the given value. |
Modifier and Type | Method and Description |
---|---|
List<? extends Config> |
Config.getConfigList(String path)
Gets a list value with
Config elements. |
Modifier and Type | Method and Description |
---|---|
void |
Config.checkValid(Config reference,
String... restrictToPaths)
Validates this config against a reference config, throwing an exception
if it is invalid.
|
static <T> T |
ConfigBeanFactory.create(Config config,
Class<T> clazz)
Creates an instance of a class, initializing its fields from a
Config . |
static Config |
ConfigFactory.load(ClassLoader loader,
Config config)
Like
ConfigFactory.load(Config) but allows you to specify
the class loader for looking up resources. |
static Config |
ConfigFactory.load(ClassLoader loader,
Config config,
ConfigResolveOptions resolveOptions)
Like
ConfigFactory.load(Config,ConfigResolveOptions) but allows you to specify
a class loader other than the context class loader. |
static Config |
ConfigFactory.load(Config config)
Assembles a standard configuration using a custom
Config
object rather than loading "application.conf". |
static Config |
ConfigFactory.load(Config config,
ConfigResolveOptions resolveOptions)
Like
ConfigFactory.load(Config) but allows you to specify
ConfigResolveOptions . |
Config |
Config.resolveWith(Config source)
Like
resolve() except that substitution values are looked
up in the given source, rather than in this instance. |
Config |
Config.resolveWith(Config source,
ConfigResolveOptions options)
Like
resolveWith(Config) but allows you to specify
non-default options. |
Modifier and Type | Method and Description |
---|---|
static Config |
ConfigImpl.computeCachedConfig(ClassLoader loader,
String key,
Callable<Config> updater) |
static Config |
ConfigImpl.defaultReference(ClassLoader loader) |
static Config |
ConfigImpl.emptyConfig(String originDescription) |
static Config |
ConfigImpl.envVariablesAsConfig() |
static Config |
ConfigImpl.systemPropertiesAsConfig() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
ConfigBeanImpl.createInternal(Config config,
Class<T> clazz)
This is public ONLY for use by the "config" package, DO NOT USE this ABI
may change.
|
Modifier and Type | Method and Description |
---|---|
static Config |
ConfigImpl.computeCachedConfig(ClassLoader loader,
String key,
Callable<Config> updater) |
Copyright © 2018 com.typesafe. All rights reserved.