T - the type of the configuration objects to producepublic class ConfigurationFactory<T> extends Object
| Constructor and Description |
|---|
ConfigurationFactory(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.
|
T |
build(File file)
Loads, parses, binds, and validates a configuration object from a file.
|
protected T |
build(com.fasterxml.jackson.databind.JsonNode node,
String path) |
public ConfigurationFactory(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
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(File file) throws IOException, ConfigurationException
file - 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
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 © 2015. All rights reserved.