Package io.dropwizard.testing
Class POJOConfigurationFactory<C extends Configuration>
- java.lang.Object
-
- io.dropwizard.configuration.BaseConfigurationFactory<T>
-
- io.dropwizard.configuration.YamlConfigurationFactory<C>
-
- io.dropwizard.testing.POJOConfigurationFactory<C>
-
- All Implemented Interfaces:
ConfigurationFactory<C>
public class POJOConfigurationFactory<C extends Configuration> extends YamlConfigurationFactory<C>
-
-
Field Summary
Fields Modifier and Type Field Description protected C
configuration
-
Fields inherited from class io.dropwizard.configuration.BaseConfigurationFactory
mapper
-
-
Constructor Summary
Constructors Constructor Description POJOConfigurationFactory(C cfg)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description C
build()
Loads, parses, binds, and validates a configuration object from an empty document.protected C
build(com.fasterxml.jackson.databind.JsonNode node, String path)
Loads, parses, binds, and validates a configuration object for a givenJsonNode
.C
build(ConfigurationSourceProvider provider, String path)
Loads, parses, binds, and validates a configuration object.C
build(File file)
Loads, parses, binds, and validates a configuration object from a file.-
Methods inherited from class io.dropwizard.configuration.BaseConfigurationFactory
addOverride, createParser
-
-
-
-
Field Detail
-
configuration
protected final C extends Configuration configuration
-
-
Constructor Detail
-
POJOConfigurationFactory
public POJOConfigurationFactory(C cfg)
-
-
Method Detail
-
build
public C build(ConfigurationSourceProvider provider, String path)
Description copied from interface:ConfigurationFactory
Loads, parses, binds, and validates a configuration object.- Specified by:
build
in interfaceConfigurationFactory<C extends Configuration>
- Overrides:
build
in classBaseConfigurationFactory<C extends Configuration>
- Parameters:
provider
- the provider to to use for reading configuration filespath
- the path of the configuration file- Returns:
- a validated configuration object
-
build
public C build(File file)
Description copied from interface:ConfigurationFactory
Loads, parses, binds, and validates a configuration object from a file.- Parameters:
file
- the path of the configuration file- Returns:
- a validated configuration object
-
build
public C build()
Description copied from interface:ConfigurationFactory
Loads, parses, binds, and validates a configuration object from an empty document.- Specified by:
build
in interfaceConfigurationFactory<C extends Configuration>
- Overrides:
build
in classBaseConfigurationFactory<C extends Configuration>
- Returns:
- a validated configuration object
-
build
protected C build(com.fasterxml.jackson.databind.JsonNode node, String path)
Description copied from class:BaseConfigurationFactory
Loads, parses, binds, and validates a configuration object for a givenJsonNode
.- Overrides:
build
in classBaseConfigurationFactory<C extends Configuration>
- Parameters:
node
- the json node to parse the configuration frompath
- the path of the configuration file- Returns:
- a validated configuration object
-
-