See: Description
| Interface | Description |
|---|---|
| Config |
Configuration
|
| Config.Builder |
Config Builder. |
| Config.Context |
Context associated with specific
Config node that allows to access the last loaded instance of the node
or to request reloading of whole configuration. |
| Config.Key |
Object represents fully-qualified key of config node.
|
| ConfigSources.MergingStrategy |
An algorithm for combining multiple
ConfigNode.ObjectNode root nodes
into a single ConfigNode.ObjectNode root node. |
| ConfigValue<T> |
A typed value of a
Config node. |
| Class | Description |
|---|---|
| ConfigFilters |
Class provides access to built-in
ConfigFilter implementations. |
| ConfigFilters.ValueResolvingBuilder |
A builder for value reference resolving filter.
|
| ConfigHelper |
Common Configuration utilities.
|
| ConfigMappers |
Utility methods for converting configuration to Java types.
|
| ConfigParsers |
Provides access to built-in
ConfigParser implementations. |
| ConfigSources |
Provides access to built-in
ConfigSource implementations. |
| ConfigSources.CompositeBuilder |
Builder of a
ConfigSource that encapsulates multiple separate
ConfigSources. |
| ConfigSources.MapBuilder |
Builder of a
ConfigSource based on a Map containing
config entries. |
| ConfigValues |
Factory for config values.
|
| OverrideSources |
Class provides access to built-in
OverrideSource implementations. |
| PollingStrategies |
Built-in
PollingStrategy implementations. |
| PollingStrategies.FilesystemWatchBuilder |
A builder for a filesystem watch polling strategy.
|
| PollingStrategies.ScheduledBuilder |
A builder for a scheduled polling strategy.
|
| RetryPolicies |
Class provides access to built-in
RetryPolicy implementations. |
| RetryPolicies.Builder |
A builder of the default
RetryPolicy. |
| Enum | Description |
|---|---|
| Config.Type |
Configuration node types.
|
| Exception | Description |
|---|---|
| ConfigException |
Exception is thrown by
Config implementations. |
| ConfigMappingException |
Configuration value mapping exception.
|
| MissingValueException |
Exception representing a specific failures related to a missing configuration value.
|
Config.create()) or
from specified ConfigSources
(using Config.Builder).
The default sources include all of the following, in order:
application.yamlapplication.conf (HOCON format)application.jsonapplication.propertiesConfigParser.
See Config for further information.
Config class.
Once loaded, configuration information is available to the program as Config
nodes in a tree. Each node has:
Config.Key representing
the full path from the root to the node, and Config.type() method
returns an enum value Config.Type that tells how the
program should interpret the content of the node.
| Type | Meaning | Useful Config Methods |
|---|---|---|
| VALUE | value node with an optional direct String value |
|
| LIST | list of indexed nodes with an optional "direct" value | Config.asList(java.lang.Class),
Config.asNodeList() |
| OBJECT | object node with, possibly, child nodes and an optional "direct" value | Config.asNodeList() |
Optional<String>, the program can also
have the node convert its String value to a typed ConfigValue using methods such as
Config.asString(), Config.asLong() etc.
The program can provide its own ConfigMapperProvider implementations
to deal with more complicated value mapping needs. See also Config.Builder.addStringMapper(java.lang.Class<T>, java.util.function.Function<java.lang.String, T>)
and Config.Builder.addMapper(java.lang.Class, java.util.function.Function).
List.
The program can navigate directly to a given subnode using the
Config.get(java.lang.String) method and passing the dotted path to the subnode.
The Config.traverse() methods return a stream of nodes
in depth-first order.
Map of dotted names to String values
for a node's entire subtree using Config.asMap().
Config.onChange(java.util.function.Function<io.helidon.config.Config, java.lang.Boolean>).
Config class provides many methods for converting config
String values to Java primitives and simple Java types, as well as
mapping parts of the config tree to Lists and Maps.
The application can convert config data to arbitrary types using the
Config.as(java.lang.Class) and Config.as(java.util.function.Function)
methods, and can provide its own conversions to handle
custom types by implementing a mapping function and registering it
with a Config.Builder using the Config.Builder.addMapper(java.lang.Class<T>, java.util.function.Function<io.helidon.config.Config, T>) method.
If the Config.as method finds no matching registered mapper it will throw
a ConfigMappingException.
Support for automated mapping to types is available in module config-beans.
Configuration SPICopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.