- java.lang.Object
-
- io.helidon.config.ConfigFilters.ValueResolvingBuilder
-
- All Implemented Interfaces:
Supplier<Function<Config,ConfigFilter>>
- Enclosing class:
- ConfigFilters
public static final class ConfigFilters.ValueResolvingBuilder extends Object implements Supplier<Function<Config,ConfigFilter>>
A builder for value reference resolving filter.The
ValueResolvingFilter
can either allow (the default) or reject references to missing tokens. To reject such references, invoke thefailOnMissingReference
method on the builder before invokingbuild()
.Alternatively, if you create the builder using the
create(io.helidon.config.Config)
method, in theConfig
instance you pass set the config key "config.value-resolving-filter.fail-on-missing-reference" totrue
.
-
-
Field Summary
Fields Modifier and Type Field Description static String
FAIL_ON_MISSING_REFERENCE_KEY_NAME
Config key for setting missing reference behavior onValueResolvingFilter
s.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Function<Config,ConfigFilter>
build()
Creates a function of values reference resolving.static ConfigFilters.ValueResolvingBuilder
create(Config metaConfig)
Initializes config filter instance from configuration properties.ConfigFilters.ValueResolvingBuilder
failOnMissingReference(boolean failOnMissing)
Sets how theValueResolvingFilter
resulting from this builder will behave when a value contains a reference to a non-existent key.Function<Config,ConfigFilter>
get()
-
-
-
Field Detail
-
FAIL_ON_MISSING_REFERENCE_KEY_NAME
public static final String FAIL_ON_MISSING_REFERENCE_KEY_NAME
Config key for setting missing reference behavior onValueResolvingFilter
s.- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public static ConfigFilters.ValueResolvingBuilder create(Config metaConfig) throws ConfigMappingException, MissingValueException
Initializes config filter instance from configuration properties.Optional
properties
:failOnMissingReference
- typeBoolean
, seefailOnMissingReference
- Parameters:
metaConfig
- meta-configuration used to initialize returned config filter instance from- Returns:
- new instance of config filter builder described by
metaConfig
- Throws:
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.- See Also:
ConfigFilters.valueResolving()
-
failOnMissingReference
public ConfigFilters.ValueResolvingBuilder failOnMissingReference(boolean failOnMissing)
Sets how theValueResolvingFilter
resulting from this builder will behave when a value contains a reference to a non-existent key.- Parameters:
failOnMissing
- whether the filter should fail on missing references or not- Returns:
- this builder
-
build
public Function<Config,ConfigFilter> build()
Creates a function of values reference resolving.- Returns:
- a provider of config filter
-
get
public Function<Config,ConfigFilter> get()
- Specified by:
get
in interfaceSupplier<Function<Config,ConfigFilter>>
-
-