本文整理汇总了Java中com.google.inject.binder.AnnotatedBindingBuilder.to方法的典型用法代码示例。如果您正苦于以下问题:Java AnnotatedBindingBuilder.to方法的具体用法?Java AnnotatedBindingBuilder.to怎么用?Java AnnotatedBindingBuilder.to使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.inject.binder.AnnotatedBindingBuilder
的用法示例。
在下文中一共展示了AnnotatedBindingBuilder.to方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bind
import com.google.inject.binder.AnnotatedBindingBuilder; //导入方法依赖的package包/类
protected void bind(BindDescriptor bindDescriptor, BindType bindType) {
switch (bindType) {
case SIMPLE:
AnnotatedBindingBuilder<?> builder = null;
if (bindDescriptor.getBind() != null) {
builder = bind(bindDescriptor.getBind());
if (bindDescriptor.getTo() != null) {
builder.to(bindDescriptor.getTo());
}
if (bindDescriptor.getIn() != null) {
builder.in(bindDescriptor.getIn());
}
}
break;
case MOCK:
bindToMock(bindDescriptor);
break;
case SPY:
bindToSpy(bindDescriptor);
break;
}
}
示例2: bindWebSecurityManager
import com.google.inject.binder.AnnotatedBindingBuilder; //导入方法依赖的package包/类
@Override
protected void bindWebSecurityManager(final AnnotatedBindingBuilder<? super WebSecurityManager> bind) {
bind(NexusWebSecurityManager.class).asEagerSingleton();
// bind RealmSecurityManager and WebSecurityManager to _same_ component
bind(RealmSecurityManager.class).to(NexusWebSecurityManager.class);
bind.to(NexusWebSecurityManager.class);
// bindings used by external modules
expose(RealmSecurityManager.class);
expose(WebSecurityManager.class);
}
示例3: bindSessionManager
import com.google.inject.binder.AnnotatedBindingBuilder; //导入方法依赖的package包/类
@Override
protected void bindSessionManager(AnnotatedBindingBuilder<SessionManager> bind) {
bind.to(DefaultWebSessionManager.class);
}
示例4: bindHealthCheckInvocationStrategy
import com.google.inject.binder.AnnotatedBindingBuilder; //导入方法依赖的package包/类
private static void bindHealthCheckInvocationStrategy(AnnotatedBindingBuilder<HealthCheckInvocationStrategy> bindingBuilder) {
bindingBuilder.to(SyncHealthCheckInvocationStrategy.class);
}