Silk DI 0.6


se.jbee.inject.bootstrap
Class BootstrapperBundle

Object
  extended by 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)

Nested Class Summary
 
Nested classes/interfaces inherited from interface se.jbee.inject.bootstrap.Bootstrapper
Bootstrapper.ModularBootstrapper<M>
 
Constructor Summary
BootstrapperBundle()
           
 
Method Summary
protected abstract  void bootstrap()
           
 void bootstrap(Bootstrapper bootstrap)
           
 void install(Class<? extends Bundle> bundle)
           
<C extends Enum<C>>
void
install(Class<? extends ModularBundle<C>> bundle, Class<C> property)
           
protected  void install(Class<? extends Module> module, Inspector inspector)
           
<M extends Enum<M> & ModularBundle<M>>
void
install(M... modules)
           
 void install(Module module)
           
protected  void install(Module module, Inspector inspector)
          Installs the given Module using the given Inspector when declaring binds.
<T> void
install(PresetModule<T> module)
           
protected
<M extends Enum<M> & ModularBundle<M>>
void
installAll(Class<M> modules)
           
protected static Module newInstance(Class<? extends Module> module)
           
 String toString()
           
 void uninstall(Class<? extends Bundle> bundle)
          Uninstalling is very different from overriding.
<M extends Enum<M> & ModularBundle<M>>
void
uninstall(M... modules)
           
protected
<M extends Enum<M> & ModularBundle<M>>
void
uninstallAll(Class<M> modules)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BootstrapperBundle

public BootstrapperBundle()
Method Detail

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 install
property - 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()

Silk DI 0.6