Class ConfigBindingModule
- java.lang.Object
-
- com.google.inject.AbstractModule
-
- ru.vyarus.dropwizard.guice.module.yaml.bind.ConfigBindingModule
-
- All Implemented Interfaces:
com.google.inject.Module
public class ConfigBindingModule extends com.google.inject.AbstractModuleBinds configuration constants. Bindings are qualified withConfig.Note that not all configuration paths may be available because configuration is introspected using jersey serialization api and some configuration classes may only consume properties (e.g. value consumed directly in setter - impossible to read back).
All content types are bound by declaration type (as they declared in configuration class). All primitive types are boxed. All collection types like List, Set, Map, Multimap are bound by collection type (List, Set etc). Generics are always used in binding (so
@inject @Config("path") List<String> valwill work and@inject @Config("path") List valwill not).Root configuration objects are bound with and without qualifier, except root interfaces which are bound with qualifier only.
ConfigurationTreeinstance is also bound directly to be used for custom configuration analysis.- Since:
- 04.05.2018
- See Also:
for more info on usage,GuiceyOptions.BindConfigurationByPath
-
-
Constructor Summary
Constructors Constructor Description ConfigBindingModule(io.dropwizard.core.Configuration configuration, ConfigurationTree tree)Create configuration bindings module.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconfigure()-
Methods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestInjection, requestStaticInjection, requireBinding, requireBinding
-
-
-
-
Constructor Detail
-
ConfigBindingModule
public ConfigBindingModule(io.dropwizard.core.Configuration configuration, ConfigurationTree tree)Create configuration bindings module.- Parameters:
configuration- configuration instance.tree- parsed configuration
-
-