|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.inject.AbstractModule
public abstract class AbstractModule
A support class for Module
s which reduces repetition and
results in a more readable configuration. Simply extends this class,
implement configure()
, and call the inherited methods which mirror
those found in ContainerBuilder
. For example:
public class MyModule extends AbstractModule { protected void configure() { bind(Foo.class).to(FooImpl.class).in(Scopes.CONTAINER); bind(BarImpl.class); link(Bar.class).to(BarImpl.class); bind("port").to(8080); } }
Constructor Summary | |
---|---|
AbstractModule()
|
Method Summary | ||
---|---|---|
protected
|
bind(java.lang.Class<T> clazz)
|
|
protected
|
bind(Key<T> key)
|
|
protected ContainerBuilder.ConstantBindingBuilder |
bind(java.lang.String name)
|
|
protected
|
bind(TypeLiteral<T> typeLiteral)
|
|
protected void |
bindProperties(java.util.Map<java.lang.String,java.lang.String> properties)
|
|
protected void |
bindProperties(java.util.Properties properties)
|
|
protected ContainerBuilder |
builder()
Gets the builder. |
|
protected abstract void |
configure()
Configures a ContainerBuilder via the exposed methods. |
|
void |
configure(ContainerBuilder builder)
Configures the given builder. |
|
protected void |
install(Module module)
|
|
protected
|
link(Key<T> key)
|
|
protected void |
requestStaticInjection(java.lang.Class<?>... types)
|
|
protected void |
scope(java.lang.String name,
Scope scope)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractModule()
Method Detail |
---|
public final void configure(ContainerBuilder builder)
Module
configure
in interface Module
protected abstract void configure()
ContainerBuilder
via the exposed methods.
protected ContainerBuilder builder()
protected void scope(java.lang.String name, Scope scope)
ContainerBuilder.scope(String, Scope)
protected <T> ContainerBuilder.BindingBuilder<T> bind(Key<T> key)
ContainerBuilder.bind(Key)
protected <T> ContainerBuilder.BindingBuilder<T> bind(TypeLiteral<T> typeLiteral)
ContainerBuilder.bind(TypeLiteral)
protected <T> ContainerBuilder.BindingBuilder<T> bind(java.lang.Class<T> clazz)
ContainerBuilder.bind(Class)
protected <T> ContainerBuilder.LinkedBindingBuilder<T> link(Key<T> key)
ContainerBuilder.link(Key)
protected ContainerBuilder.ConstantBindingBuilder bind(java.lang.String name)
ContainerBuilder.bind(String)
protected void bindProperties(java.util.Map<java.lang.String,java.lang.String> properties)
ContainerBuilder.bindProperties(java.util.Map)
protected void bindProperties(java.util.Properties properties)
ContainerBuilder.bindProperties(java.util.Properties)
protected void requestStaticInjection(java.lang.Class<?>... types)
ContainerBuilder.requestStaticInjection(Class[])
protected void install(Module module)
ContainerBuilder.install(Module)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |