Package io.dropwizard.configuration
Class DefaultConfigurationFactoryFactory<T>
- java.lang.Object
-
- io.dropwizard.configuration.DefaultConfigurationFactoryFactory<T>
-
- Type Parameters:
T
- the type of the configuration objects to produce
- All Implemented Interfaces:
ConfigurationFactoryFactory<T>
public class DefaultConfigurationFactoryFactory<T> extends Object implements ConfigurationFactoryFactory<T>
The default implementation for theConfigurationFactoryFactory
interface. An instance of this class constructs a newYamlConfigurationFactory
.
-
-
Constructor Summary
Constructors Constructor Description DefaultConfigurationFactoryFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.fasterxml.jackson.databind.ObjectMapper
configureObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Provides additional configuration for theObjectMapper
used to read the configuration.ConfigurationFactory<T>
create(Class<T> klass, jakarta.validation.Validator validator, com.fasterxml.jackson.databind.ObjectMapper objectMapper, String propertyPrefix)
Creates a new configuration factory for the given class.
-
-
-
Method Detail
-
create
public ConfigurationFactory<T> create(Class<T> klass, jakarta.validation.Validator validator, com.fasterxml.jackson.databind.ObjectMapper objectMapper, String propertyPrefix)
Description copied from interface:ConfigurationFactoryFactory
Creates a new configuration factory for the given class.- Specified by:
create
in interfaceConfigurationFactoryFactory<T>
- Parameters:
klass
- the configuration classvalidator
- the validator to useobjectMapper
- the JacksonObjectMapper
to usepropertyPrefix
- the system property name prefix used by overrides- Returns:
- the new configuration factory
-
configureObjectMapper
protected com.fasterxml.jackson.databind.ObjectMapper configureObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Provides additional configuration for theObjectMapper
used to read the configuration. By defaultDeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES
is enabled to protect against misconfiguration.- Parameters:
objectMapper
- template to be configured- Returns:
- configured object mapper
-
-