T - the type of the configuration objects to produceConfigurationFactory<T>JsonConfigurationFactory, YamlConfigurationFactorypublic abstract class BaseConfigurationFactory<T> extends java.lang.Object implements ConfigurationFactory<T>
| Modifier and Type | Field | Description |
|---|---|---|
protected com.fasterxml.jackson.databind.ObjectMapper |
mapper |
| Constructor | Description |
|---|---|
BaseConfigurationFactory(com.fasterxml.jackson.core.JsonFactory parserFactory,
java.lang.String formatName,
java.lang.Class<T> klass,
javax.validation.Validator validator,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
java.lang.String propertyPrefix) |
Creates a new configuration factory for the given class.
|
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
addOverride(com.fasterxml.jackson.databind.JsonNode root,
java.lang.String name,
java.lang.String value) |
|
T |
build() |
Loads, parses, binds, and validates a configuration object from an empty document.
|
protected T |
build(com.fasterxml.jackson.databind.JsonNode node,
java.lang.String path) |
|
T |
build(ConfigurationSourceProvider provider,
java.lang.String path) |
Loads, parses, binds, and validates a configuration object.
|
protected com.fasterxml.jackson.core.JsonParser |
createParser(java.io.InputStream input) |
buildpublic BaseConfigurationFactory(com.fasterxml.jackson.core.JsonFactory parserFactory,
java.lang.String formatName,
java.lang.Class<T> klass,
@Nullable
javax.validation.Validator validator,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
java.lang.String propertyPrefix)
parserFactory - the factory that creates the parser usedformatName - the name of the format parsed by this factory (used in exceptions)klass - the configuration classvalidator - the validator to usepropertyPrefix - the system property name prefix used by overridespublic T build(ConfigurationSourceProvider provider, java.lang.String path) throws java.io.IOException, ConfigurationException
ConfigurationFactorybuild in interface ConfigurationFactory<T>provider - the provider to to use for reading configuration filespath - the path of the configuration filejava.io.IOException - if there is an error reading the fileConfigurationException - if there is an error parsing or validating the fileprotected com.fasterxml.jackson.core.JsonParser createParser(java.io.InputStream input)
throws java.io.IOException
java.io.IOExceptionpublic T build() throws java.io.IOException, ConfigurationException
ConfigurationFactorybuild in interface ConfigurationFactory<T>java.io.IOException - if there is an error reading the fileConfigurationException - if there is an error parsing or validating the fileprotected T build(com.fasterxml.jackson.databind.JsonNode node, java.lang.String path) throws java.io.IOException, ConfigurationException
java.io.IOExceptionConfigurationExceptionprotected void addOverride(com.fasterxml.jackson.databind.JsonNode root,
java.lang.String name,
java.lang.String value)
Copyright © 2018. All rights reserved.