Package com.typesafe.config

An API for loading and using configuration files, see the project site for more information.

See:
          Description

Interface Summary
Config An immutable map from config paths to config values.
ConfigIncludeContext Context provided to a ConfigIncluder; this interface is only useful inside a ConfigIncluder implementation, and is not intended for apps to implement.
ConfigIncluder Implement this interface and provide an instance to ConfigParseOptions.setIncluder() to customize handling of include statements in config files.
ConfigIncluderClasspath Implement this in addition to ConfigIncluder if you want to support inclusion of files with the include classpath("resource") syntax.
ConfigIncluderFile Implement this in addition to ConfigIncluder if you want to support inclusion of files with the include file("filename") syntax.
ConfigIncluderURL Implement this in addition to ConfigIncluder if you want to support inclusion of files with the include url("http://example.com") syntax.
ConfigList Subtype of ConfigValue representing a list value, as in JSON's [1,2,3] syntax.
ConfigMergeable Marker for types whose instances can be merged, that is Config and ConfigValue.
ConfigObject Subtype of ConfigValue representing an object (dictionary, map) value, as in JSON's { "a" : 42 } syntax.
ConfigOrigin Represents the origin (such as filename and line number) of a ConfigValue for use in error messages.
ConfigParseable An opaque handle to something that can be parsed, obtained from ConfigIncludeContext.
ConfigValue An immutable value, following the JSON type schema.
 

Class Summary
ConfigException.ValidationProblem Information about a problem that occurred in Config.checkValid(com.typesafe.config.Config, java.lang.String...).
ConfigFactory Contains static methods for creating Config instances.
ConfigParseOptions A set of options related to parsing.
ConfigRenderOptions A set of options related to rendering a ConfigValue.
ConfigResolveOptions A set of options related to resolving substitutions.
ConfigUtil Contains static utility methods.
ConfigValueFactory This class holds some static factory methods for building ConfigValue instances.
 

Enum Summary
ConfigSyntax The syntax of a character stream, JSON, HOCON aka ".conf", or Java properties.
ConfigValueType The type of a configuration value (following the JSON type schema).
 

Exception Summary
ConfigException All exceptions thrown by the library are subclasses of ConfigException.
ConfigException.BadPath Exception indicating that a path expression was invalid.
ConfigException.BadValue Exception indicating that a value was messed up, for example you may have asked for a duration and the value can't be sensibly parsed as a duration.
ConfigException.BugOrBroken Exception indicating that there's a bug in something (possibly the library itself) or the runtime environment is broken.
ConfigException.Generic Exception that doesn't fall into any other category.
ConfigException.IO Exception indicating that there was an IO error.
ConfigException.Missing Exception indicates that the setting was never set to anything, not even null.
ConfigException.NotResolved Exception indicating that you tried to use a function that requires substitutions to be resolved, but substitutions have not been resolved (that is, Config.resolve() was not called).
ConfigException.Null Exception indicates that the setting was treated as missing because it was set to null.
ConfigException.Parse Exception indicating that there was a parse error.
ConfigException.UnresolvedSubstitution Exception indicating that a substitution did not resolve to anything.
ConfigException.ValidationFailed Exception indicating that Config.checkValid(com.typesafe.config.Config, java.lang.String...) found validity problems.
ConfigException.WrongType Exception indicating that the type of a value does not match the type you requested.
 

Package com.typesafe.config Description

An API for loading and using configuration files, see the project site for more information.

Typically you would load configuration with a static method from ConfigFactory and then use it with methods in the Config interface.

An application can simply call ConfigFactory.load() and place its configuration in "application.conf" on the classpath. If you use the default configuration from ConfigFactory.load() there's no need to pass a configuration to your libraries and frameworks, as long as they all default to this same default, which they should.

A library or framework should ship a file "reference.conf" in its jar, and allow an application to pass in a Config to be used for the library. If no Config is provided, call ConfigFactory.load() to get the default one. Typically a library might offer two constructors, one with a Config parameter and one which uses ConfigFactory.load().

You can find an example app and library on GitHub.