T - the type of the configuration objects to producepublic class YamlConfigurationFactory<T> extends Object implements ConfigurationFactory<T>
| Constructor and Description |
|---|
YamlConfigurationFactory(Class<T> klass,
javax.validation.Validator validator,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
String propertyPrefix)
Creates a new configuration factory for the given class.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addOverride(com.fasterxml.jackson.databind.JsonNode root,
String name,
String value) |
T |
build()
Loads, parses, binds, and validates a configuration object from an empty document.
|
T |
build(ConfigurationSourceProvider provider,
String path)
Loads, parses, binds, and validates a configuration object.
|
protected T |
build(com.fasterxml.jackson.databind.JsonNode node,
String path) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuildpublic YamlConfigurationFactory(Class<T> klass, javax.validation.Validator validator, com.fasterxml.jackson.databind.ObjectMapper objectMapper, String propertyPrefix)
klass - the configuration classvalidator - the validator to useobjectMapper - the Jackson ObjectMapper to usepropertyPrefix - the system property name prefix used by overridespublic T build(ConfigurationSourceProvider provider, String path) throws IOException, ConfigurationException
ConfigurationFactorybuild in interface ConfigurationFactory<T>provider - the provider to to use for reading configuration filespath - the path of the configuration fileIOException - if there is an error reading the fileConfigurationException - if there is an error parsing or validating the filepublic T build() throws IOException, ConfigurationException
ConfigurationFactorybuild in interface ConfigurationFactory<T>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, String path) throws IOException, ConfigurationException
IOExceptionConfigurationExceptionCopyright © 2016. All rights reserved.