com.google.inject.Binding.acceptScopingVisitor()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(112)

本文整理了Java中com.google.inject.Binding.acceptScopingVisitor()方法的一些代码示例,展示了Binding.acceptScopingVisitor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Binding.acceptScopingVisitor()方法的具体详情如下:
包路径:com.google.inject.Binding
类名称:Binding
方法名:acceptScopingVisitor

Binding.acceptScopingVisitor介绍

[英]Accepts a scoping visitor. Invokes the visitor method specific to this binding's scoping.
[中]接受范围界定访问者。调用特定于此绑定作用域的访问者方法。

代码示例

代码示例来源:origin: com.google.inject/guice

private Scope getScopeInstanceOrNull(Binding<?> binding) {
  return binding.acceptScopingVisitor(
    new DefaultBindingScopingVisitor<Scope>() {
     @Override
     public Scope visitScope(Scope scope) {
      return scope;
     }
    });
 }
}

代码示例来源:origin: com.google.inject/guice

private Object scope(Binding<?> binding) {
 return binding.acceptScopingVisitor(this);
}

代码示例来源:origin: ninjaframework/ninja

binding.acceptScopingVisitor(new DefaultBindingScopingVisitor() {
  @Override
  public Object visitEagerSingleton() {

代码示例来源:origin: com.google.inject/guice

boolean singleton = binding.acceptScopingVisitor(IS_SINGLETON_VISITOR);
if (singleton) {
 return true;

代码示例来源:origin: com.google.inject/guice

do {
 boolean matches =
   binding.acceptScopingVisitor(
     new BindingScopingVisitor<Boolean>() {
      @Override

代码示例来源:origin: com.google.inject.extensions/guice-servlet

expect(binding.acceptScopingVisitor((BindingScopingVisitor) anyObject())).andReturn(true);
expect(injector.getInstance(Key.get(Filter.class))).andReturn(mockFilter).anyTimes();

代码示例来源:origin: com.google.inject.extensions/guice-servlet

expect(binding.acceptScopingVisitor((BindingScopingVisitor) anyObject())).andReturn(true);
expect(injector.getInstance(Key.get(Filter.class))).andReturn(mockFilter).anyTimes();

代码示例来源:origin: com.google.inject.extensions/guice-servlet

HttpServletResponse response = createMock(HttpServletResponse.class);
expect(binding.acceptScopingVisitor((BindingScopingVisitor) anyObject())).andReturn(true);
expect(injector.getBinding(Key.get(HttpServlet.class))).andReturn(binding);

代码示例来源:origin: com.google.inject.extensions/guice-servlet

HttpServletResponse response = createMock(HttpServletResponse.class);
expect(binding.acceptScopingVisitor((BindingScopingVisitor) anyObject())).andReturn(true);
expect(injector.getBinding(Key.get(HttpServlet.class))).andReturn(binding);

代码示例来源:origin: com.google.inject.extensions/guice-servlet

HttpServletResponse response = createMock(HttpServletResponse.class);
expect(binding.acceptScopingVisitor((BindingScopingVisitor) anyObject())).andReturn(true);
expect(injector.getBinding(Key.get(HttpServlet.class))).andReturn(binding);

代码示例来源:origin: com.google.inject.extensions/guice-servlet

expect(binding.acceptScopingVisitor((BindingScopingVisitor) anyObject())).andReturn(true);
expect(injector.getBinding(Key.get(HttpServlet.class))).andReturn(binding);

代码示例来源:origin: com.google.inject.extensions/guice-servlet

expect(binding.acceptScopingVisitor((BindingScopingVisitor) anyObject())).andReturn(true);
expect(injector.getBinding(Key.get(HttpServlet.class))).andReturn(binding);
expect(injector.getInstance(HTTP_SERLVET_KEY)).andReturn(mockServlet);

代码示例来源:origin: com.google.inject.extensions/guice-servlet

expect(binding.acceptScopingVisitor((BindingScopingVisitor) anyObject())).andReturn(true);
expect(injector.getBinding(Key.get(HttpServlet.class))).andReturn(binding);

代码示例来源:origin: com.google.inject.extensions/guice-servlet

Binding binding = createMock(Binding.class);
expect(binding.acceptScopingVisitor((BindingScopingVisitor) anyObject())).andReturn(true);
expect(injector.getBinding(Key.get(HttpServlet.class))).andReturn(binding);
final HttpServlet mockServlet = new HttpServlet() {};

代码示例来源:origin: com.google.inject.extensions/guice-servlet

expect(binding.acceptScopingVisitor((BindingScopingVisitor) anyObject())).andReturn(true);
expect(injector.getBinding(Key.get(Filter.class))).andReturn(binding);

代码示例来源:origin: com.google/inject

private Scope getScopeInstanceOrNull(Binding<?> binding) {
  return binding.acceptScopingVisitor(new DefaultBindingScopingVisitor<Scope>() {
   public Scope visitScope(Scope scope) {
    return scope;
   }
  });
 }
};

代码示例来源:origin: com.google.inject.extensions/guice-servlet

expect(binding.acceptScopingVisitor((BindingScopingVisitor) anyObject())).andReturn(true);
expect(injector.getBinding(Key.get(Filter.class))).andReturn(binding);

代码示例来源:origin: com.google.inject.extensions/guice-servlet

expect(binding.acceptScopingVisitor((BindingScopingVisitor) anyObject())).andReturn(true);
expect(injector.getBinding(Key.get(Filter.class))).andReturn(binding);

代码示例来源:origin: org.jukito/jukito

public static BindingInfo create(Binding<?> binding, Key<?> boundKey,
    Object instance) {
  BindingInfo bindingInfo = new BindingInfo();
  bindingInfo.key = binding.getKey();
  bindingInfo.boundKey = boundKey;
  bindingInfo.boundInstance = instance;
  bindingInfo.scope = binding.acceptScopingVisitor(new GuiceScopingVisitor());
  return bindingInfo;
}

代码示例来源:origin: ArcBees/Jukito

public static BindingInfo create(Binding<?> binding, Key<?> boundKey,
    Object instance) {
  BindingInfo bindingInfo = new BindingInfo();
  bindingInfo.key = binding.getKey();
  bindingInfo.boundKey = boundKey;
  bindingInfo.boundInstance = instance;
  bindingInfo.scope = binding.acceptScopingVisitor(new GuiceScopingVisitor());
  return bindingInfo;
}

相关文章