T
- Java type to which the ConfigMapper
converts
Config
subtree.@FunctionalInterface
public interface ConfigMapper<T>
The application can register mappers on a Builder
using the
Config.Builder.addMapper(Class, ConfigMapper)
method. The config
system also locates mappers using the
ConfigMapperProvider
SPI that it discovers using
the Java ServiceLoader
mechanism and automatically adds
them to every Builder
unless the application disables this feature
for a given Builder
by invoking
Config.Builder.disableMapperServices()
.
Config.Builder.addMapper(Class, ConfigMapper)
,
Config.Builder.addMapper(Class, java.util.function.Function)
,
Config.Builder.addMapper(io.helidon.config.spi.ConfigMapperProvider)
,
Config.as(Class)
,
Config.as(Class, Object)
,
Config.asOptional(Class)
,
Config.asList(Class)
,
Config.asList(Class, java.util.List)
,
Config.asOptionalList(Class)
,
Config.map(ConfigMapper)
,
Config.map(ConfigMapper, Object)
,
Config.mapOptional(ConfigMapper)
,
Config.mapList(ConfigMapper)
,
Config.mapList(ConfigMapper, java.util.List)
,
Config.mapOptionalList(ConfigMapper)
,
ConfigMappers
,
ConfigMapperProvider
,
Config.Value
Modifier and Type | Method | Description |
---|---|---|
T |
apply(Config config) |
Maps a configuration hierarchy to a Java representation.
|
T apply(Config config) throws ConfigMappingException, MissingValueException
config
- configuration node representing a configuration tree to be mapped to an instance of a Java type.MissingValueException
- in case the configuration tree does not contain all expected sub-nodes
required by the mapper implementation to provide instance of Java type.ConfigMappingException
- in case the mapper fails to map the (existing) configuration tree represented by the
supplied configuration node to an instance of a given Java type.Copyright © 2018 Oracle Corporation. All rights reserved.