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
FieldsModifier and TypeFieldDescriptionprotected GuiceConfigA reference to the Guice Config environment that is automatically set beforeAbstractModule.configure()is called -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> JAXBResourceProvider<T>bindConfigFile(Class<T> type, String propertyName) Adds a new binding for the given JAXBtypeto a config sourcepropertyName.protected voidinstall(com.google.inject.Module module) voidsetConfig(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 JAXBtypeto a config sourcepropertyName. This binding registers aJAXBResourceProviderthat 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:
installin classcom.google.inject.AbstractModule
-