Expressions
Expressions can be used to reference other configuration parameters or to call resolvers to get the values of environment variables, imported symbols, command execution results and more.
To return the value of other configuration parameters, use the dotted path to the parameter within the ${ and } delimiters.
For example, in the configuration below, calling config.get("url") will automatically resolve the expression and return http://localhost:8080:
server:
host: localhost
port: 8080
url: "http://${server.host}:${server.port}"Resolved values do not have to be simple scalars and all nested and recursive expressions are resolved.
For instance, the expression ${server} resolves to the mapping {"host": "localhost", "port": 8080}, while ${url} recursively resolves ${server.host} and ${server.port} to return http://localhost:8080.
When a configuration uses a special key like _target_ to instantiate an object, the expression will resolve to the return value of the function call or constructor (see Object Instantiation).
Note: At present, return values are not cached, so when instantiating objects via classes or functions, multiple calls to config.get or resolving multiple expressions within a file may return different instances. This behavior should not, however, be relied upon, as caching may be introduced as the default behavior in the future.
Expressions can also call resolvers to access values beyond the configuration. See Resolvers for the list of supported resolvers and how to register your own.