public class ContextSensitiveBinder extends Object
ContextSensitiveProvider
s.
For example, to bind a custom logger provider, you can write this inside AbstractModule.configure()
:
ContextSensitiveBinder.create(binder()) .bind(CustomLogger.class) .toContextSensitiveProvider(CustomLoggerProvider.class);
Modifier and Type | Method and Description |
---|---|
<T> AnnotatedContextSensitiveBindingBuilder<T> |
bind(Class<T> type)
See the EDSL examples
here . |
<T> ContextSensitiveBindingBuilder<T> |
bind(Key<T> key)
See the EDSL examples
here . |
<T> AnnotatedContextSensitiveBindingBuilder<T> |
bind(TypeLiteral<T> type)
See the EDSL examples
here . |
static ContextSensitiveBinder |
create(Binder binder)
Create a
ContextSensitiveBinder . |
public static ContextSensitiveBinder create(Binder binder)
ContextSensitiveBinder
.binder
- The Binder
to use.ContextSensitiveBinder
instance.public <T> AnnotatedContextSensitiveBindingBuilder<T> bind(Class<T> type)
here
.public <T> AnnotatedContextSensitiveBindingBuilder<T> bind(TypeLiteral<T> type)
here
.public <T> ContextSensitiveBindingBuilder<T> bind(Key<T> key)
here
.Copyright © 2014. All rights reserved.