se.jbee.inject.bootstrap
Class BootstrapperBundle
Object
se.jbee.inject.bootstrap.BootstrapperBundle
- All Implemented Interfaces:
- Bootstrapper, Bundle
public abstract class BootstrapperBundle
- extends Object
- implements Bundle, Bootstrapper
The default utility Bundle that is a Bootstrap as well so that bindings can be
declared nicer.
- Author:
- Jan Bernitt (jan@jbee.se)
| Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
BootstrapperBundle
public BootstrapperBundle()
bootstrap
public final void bootstrap(Bootstrapper bootstrap)
- Specified by:
bootstrap in interface Bundle
- Parameters:
bootstrap - The Bootstrapper this Bundle should install itself to.
install
public final void install(Class<? extends Bundle> bundle)
- Specified by:
install in interface Bootstrapper
- Parameters:
bundle - the Bundle to expand further
install
public final void install(Module module)
- Specified by:
install in interface Bootstrapper
- Parameters:
module - the Module to install (within the parent Bundle that is given
implicit - the Bootstrapper.ModularBootstrapper keeps track of that)
install
public final <T> void install(PresetModule<T> module)
- Specified by:
install in interface Bootstrapper
- Type Parameters:
T - Type of the preset value passed to the module- Parameters:
module - the PresetModule to install (within the parent Bundle that is
given implicitly - the Bootstrapper.ModularBootstrapper keeps track of that)
uninstall
public final void uninstall(Class<? extends Bundle> bundle)
- Description copied from interface:
Bootstrapper
- Uninstalling is very different from overriding. It allows to totally remove a well defined
part from the consideration while a override complects the overridden and the overriding
Bundle with each other and requires to considerer both in a complected form.
To allow predictability uninstalling is a final decision. Further calls that install the very
same
Bundle will not re-install it!
There is no need to uninstall a Module since uninstalling the Bundle
that installed the module will effectively uninstall the module as well (as long as that
module is not installed by another installed bundle too). Allowing to uninstall separate
Modules would break the well defined borders of bundles and lead to the need to
consider something close to overrides.
- Specified by:
uninstall in interface Bootstrapper
install
public final <M extends Enum<M> & ModularBundle<M>> void install(M... modules)
- Specified by:
install in interface Bootstrapper
- Parameters:
modules - The choices made to install.
install
public final <C extends Enum<C>> void install(Class<? extends ModularBundle<C>> bundle,
Class<C> property)
- Specified by:
install in interface Bootstrapper
- Parameters:
bundle - the Bundle to installproperty - The property the installation is connected to.- See Also:
Options
uninstall
public final <M extends Enum<M> & ModularBundle<M>> void uninstall(M... modules)
- Specified by:
uninstall in interface Bootstrapper
- Parameters:
modules - The choices made to uninstall again.
installAll
protected final <M extends Enum<M> & ModularBundle<M>> void installAll(Class<M> modules)
uninstallAll
protected final <M extends Enum<M> & ModularBundle<M>> void uninstallAll(Class<M> modules)
install
protected final void install(Module module,
Inspector inspector)
- Installs the given
Module using the given Inspector when declaring binds.
install
protected final void install(Class<? extends Module> module,
Inspector inspector)
newInstance
protected static Module newInstance(Class<? extends Module> module)
toString
public String toString()
- Overrides:
toString in class Object
bootstrap
protected abstract void bootstrap()