Class BaseConfigurationFactory<T>

  • Type Parameters:
    T - the type of the configuration objects to produce
    All Implemented Interfaces:
    ConfigurationFactory<T>
    Direct Known Subclasses:
    JsonConfigurationFactory, YamlConfigurationFactory

    public abstract class BaseConfigurationFactory<T>
    extends Object
    implements ConfigurationFactory<T>
    A generic factory class for loading configuration files, binding them to configuration objects, and validating their constraints. Allows for overriding configuration parameters from system properties.
    • Field Detail

      • mapper

        protected final com.fasterxml.jackson.databind.ObjectMapper mapper
    • Constructor Detail

      • BaseConfigurationFactory

        protected BaseConfigurationFactory​(com.fasterxml.jackson.core.JsonFactory parserFactory,
                                           String formatName,
                                           Class<T> klass,
                                           @Nullable
                                           javax.validation.Validator validator,
                                           com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                                           String propertyPrefix)
        Creates a new configuration factory for the given class.
        Parameters:
        parserFactory - the factory that creates the parser used
        formatName - the name of the format parsed by this factory (used in exceptions)
        klass - the configuration class
        validator - the validator to use
        propertyPrefix - the system property name prefix used by overrides