Package com.peterphi.std.guice.common
Class GuiceModule
java.lang.Object
com.google.inject.AbstractModule
com.peterphi.std.guice.common.GuiceModule
- All Implemented Interfaces:
com.google.inject.Module
public abstract class GuiceModule
extends com.google.inject.AbstractModule
Helper class for modules
-
Field Summary
Modifier and TypeFieldDescriptionprotected GuiceConfig
A reference to the Guice Config environment that is automatically set beforeAbstractModule.configure()
is called -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected <T> JAXBResourceProvider<T>
bindConfigFile
(Class<T> type, String propertyName) Adds a new binding for the given JAXBtype
to a config sourcepropertyName
.protected void
install
(com.google.inject.Module module) void
setConfig
(GuiceConfig config) Methods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, requestInjection, requestStaticInjection, requireBinding, requireBinding
-
Field Details
-
config
A reference to the Guice Config environment that is automatically set beforeAbstractModule.configure()
is called
-
-
Constructor Details
-
GuiceModule
public GuiceModule()
-
-
Method Details
-
setConfig
-
bindConfigFile
Adds a new binding for the given JAXBtype
to a config sourcepropertyName
. This binding registers aJAXBResourceProvider
that can auto-reload if the underlying file changes- Type Parameters:
T
- type of the config file- Parameters:
type
- the config typepropertyName
- the GuiceConfig property to read from for the config
-
install
protected void install(com.google.inject.Module module) - Overrides:
install
in classcom.google.inject.AbstractModule
-