Package io.helidon.config.objectmapping
Class ObjectConfigMapperProvider
- java.lang.Object
-
- io.helidon.config.objectmapping.ObjectConfigMapperProvider
-
- All Implemented Interfaces:
ConfigMapperProvider
@Priority(1000) public class ObjectConfigMapperProvider extends Object implements ConfigMapperProvider
Java beans support for configuration.
-
-
Field Summary
-
Fields inherited from interface io.helidon.config.spi.ConfigMapperProvider
PRIORITY
-
-
Constructor Summary
Constructors Constructor Description ObjectConfigMapperProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Optional<Function<Config,T>>
mapper(Class<T> type)
A simple mapping function from config node to a typed value based on the expected class.Map<Class<?>,Function<Config,?>>
mappers()
Returns a map of mapper functions associated with appropriate target type (Class<?>
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.helidon.config.spi.ConfigMapperProvider
genericTypeMappers, mapper
-
-
-
-
Method Detail
-
mappers
public Map<Class<?>,Function<Config,?>> mappers()
Description copied from interface:ConfigMapperProvider
Returns a map of mapper functions associated with appropriate target type (Class<?>
.Mappers will by automatically registered by
Config.Builder
during bootstrapping ofConfig
unlessdisableld
.- Specified by:
mappers
in interfaceConfigMapperProvider
- Returns:
- a map of config mapper functions, never
null
, though this may return an empty map ifConfigMapperProvider.mapper(Class)
is used instead
-
mapper
public <T> Optional<Function<Config,T>> mapper(Class<T> type)
Description copied from interface:ConfigMapperProvider
A simple mapping function from config node to a typed value based on the expected class. If more complex type handling or conversion is needed, useConfigMapperProvider.mapper(GenericType)
.- Specified by:
mapper
in interfaceConfigMapperProvider
- Type Parameters:
T
- type returned from conversion- Parameters:
type
- type of the expected mapping result- Returns:
- function to convert config node to the expected type, or empty if the type is not supported by this provider
-
-