|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.inject.client.multibindings.GinMultibinder<T>
T
- type of value for Setpublic final class GinMultibinder<T>
A utility that mimics the behavior and API of Guice Multibinder for GIN.
Example usage:
interface X {}; class X1Impl implements X {}; class X2Impl implements X {}; class X3Provider implements Provider<X> { ... }; Set<X> multibinder = GinMultibinder.newSetBinder(binder(), X.class); multibinder.addBinding().to(X1Impl.class); multibinder.addBinding().to(X2Impl.class); multibinder.addBinding().toProvier(X3Provider.class);
Constructor Summary | |
---|---|
GinMultibinder(GinBinder ginBinder,
TypeLiteral<T> elementType,
Key<Provider<T>> keyForMultibinding)
|
Method Summary | ||
---|---|---|
GinLinkedBindingBuilder<T> |
addBinding()
Returns a binding builder used to add a new element in the set. |
|
static
|
newSetBinder(GinBinder binder,
java.lang.Class<T> type)
Returns a new multibinder that collects instances of type in a Set
that is itself bound with no binding annotation. |
|
static
|
newSetBinder(GinBinder binder,
java.lang.Class<T> type,
java.lang.annotation.Annotation annotation)
Returns a new multibinder that collects instances of type in a Set
that is itself bound with annotation . |
|
static
|
newSetBinder(GinBinder binder,
java.lang.Class<T> type,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Returns a new multibinder that collects instances of type in a Set that is
itself bound with annotationType . |
|
static
|
newSetBinder(GinBinder binder,
TypeLiteral<T> type)
Returns a new multibinder that collects instances of type in a Set
that is itself bound with no binding annotation. |
|
static
|
newSetBinder(GinBinder binder,
TypeLiteral<T> type,
java.lang.annotation.Annotation annotation)
Returns a new multibinder that collects instances of type in a Set
that is itself bound with annotation . |
|
static
|
newSetBinder(GinBinder binder,
TypeLiteral<T> type,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Returns a new multibinder that collects instances of type in a Set
that is itself bound with annotationType . |
|
GinMultibinder<T> |
permitDuplicates()
Configures the bound set to silently discard duplicate elements. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GinMultibinder(GinBinder ginBinder, TypeLiteral<T> elementType, Key<Provider<T>> keyForMultibinding)
Method Detail |
---|
public static <T> GinMultibinder<T> newSetBinder(GinBinder binder, TypeLiteral<T> type)
type
in a Set
that is itself bound with no binding annotation.
public static <T> GinMultibinder<T> newSetBinder(GinBinder binder, java.lang.Class<T> type)
type
in a Set
that is itself bound with no binding annotation.
public static <T> GinMultibinder<T> newSetBinder(GinBinder binder, TypeLiteral<T> type, java.lang.annotation.Annotation annotation)
type
in a Set
that is itself bound with annotation
.
public static <T> GinMultibinder<T> newSetBinder(GinBinder binder, java.lang.Class<T> type, java.lang.annotation.Annotation annotation)
type
in a Set
that is itself bound with annotation
.
public static <T> GinMultibinder<T> newSetBinder(GinBinder binder, TypeLiteral<T> type, java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
type
in a Set
that is itself bound with annotationType
.
public static <T> GinMultibinder<T> newSetBinder(GinBinder binder, java.lang.Class<T> type, java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
type
in a Set
that is
itself bound with annotationType
.
public GinMultibinder<T> permitDuplicates()
public GinLinkedBindingBuilder<T> addBinding()
It is an error to call this method without also calling one of the to
methods on the
returned binding builder.
Scoping elements independently is supported. Use the in
method to specify a binding
scope.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |