Java 类com.google.inject.spi.ProvisionListenerBinding 实例源码

项目:guice    文件:ProvisionListenerCallbackStore.java   
/**
 * Creates a new {@link ProvisionListenerStackCallback} with the correct listeners for the key.
 */
private <T> ProvisionListenerStackCallback<T> create(Binding<T> binding) {
  List<ProvisionListener> listeners = null;
  for (ProvisionListenerBinding provisionBinding : listenerBindings) {
    if (provisionBinding.getBindingMatcher().matches(binding)) {
      if (listeners == null) {
        listeners = Lists.newArrayList();
      }
      listeners.addAll(provisionBinding.getListeners());
    }
  }
  if (listeners == null || listeners.isEmpty()) {
    // Optimization: don't bother constructing the callback if there are
    // no listeners.
    return ProvisionListenerStackCallback.emptyListener();
  }
  return new ProvisionListenerStackCallback<T>(binding, listeners);
}
项目:guice-old    文件:ProvisionListenerCallbackStore.java   
/**
 * Creates a new {@link ProvisionListenerStackCallback} with the correct listeners
 * for the key.
 */
private <T> ProvisionListenerStackCallback<T> create(Binding<T> binding) {
  List<ProvisionListener> listeners = null;
  for (ProvisionListenerBinding provisionBinding : listenerBindings) {
    if (provisionBinding.getBindingMatcher().matches(binding)) {
      if (listeners == null) {
        listeners = Lists.newArrayList();
      }
      listeners.addAll(provisionBinding.getListeners());
    }
  }
  if (listeners == null || listeners.isEmpty()) {
    // Optimization: don't bother constructing the callback if there are
    // no listeners.
    return ProvisionListenerStackCallback.emptyListener();
  }
  return new ProvisionListenerStackCallback<T>(binding, listeners);
}
项目:google-guice    文件:ProvisionListenerCallbackStore.java   
/**
 * Creates a new {@link ProvisionListenerStackCallback} with the correct listeners
 * for the key.
 */
private <T> ProvisionListenerStackCallback<T> create(Binding<T> binding) {
  List<ProvisionListener> listeners = null;
  for (ProvisionListenerBinding provisionBinding : listenerBindings) {
    if (provisionBinding.getBindingMatcher().matches(binding)) {
      if (listeners == null) {
        listeners = Lists.newArrayList();
      }
      listeners.addAll(provisionBinding.getListeners());
    }
  }
  if (listeners == null || listeners.isEmpty()) {
    // Optimization: don't bother constructing the callback if there are
    // no listeners.
    return ProvisionListenerStackCallback.emptyListener();
  }
  return new ProvisionListenerStackCallback<T>(binding, listeners);
}
项目:guice    文件:InheritingState.java   
@Override
public List<ProvisionListenerBinding> getProvisionListenerBindings() {
  List<ProvisionListenerBinding> parentBindings = parent.getProvisionListenerBindings();
  List<ProvisionListenerBinding> result =
      Lists.newArrayListWithCapacity(parentBindings.size() + provisionListenerBindings.size());
  result.addAll(parentBindings);
  result.addAll(provisionListenerBindings);
  return result;
}
项目:guice-old    文件:InheritingState.java   
public List<ProvisionListenerBinding> getProvisionListenerBindings() {
  List<ProvisionListenerBinding> parentBindings = parent.getProvisionListenerBindings();
  List<ProvisionListenerBinding> result
      = new ArrayList<ProvisionListenerBinding>(parentBindings.size() + 1);
  result.addAll(parentBindings);
  result.addAll(provisionListenerBindings);
  return result;
}
项目:google-guice    文件:InheritingState.java   
public List<ProvisionListenerBinding> getProvisionListenerBindings() {
  List<ProvisionListenerBinding> parentBindings = parent.getProvisionListenerBindings();
  List<ProvisionListenerBinding> result
      = new ArrayList<ProvisionListenerBinding>(parentBindings.size() + 1);
  result.addAll(parentBindings);
  result.addAll(provisionListenerBindings);
  return result;
}
项目:ProjectAres    文件:ElementInspector.java   
@Override
public V visit(ProvisionListenerBinding binding) {
    return message(binding,
                   "Binding provision listeners " + binding.getListeners() +
                   " for bindings matching " + binding.getBindingMatcher());
}
项目:guice    文件:InheritingState.java   
@Override
public void addProvisionListener(ProvisionListenerBinding listenerBinding) {
  provisionListenerBindings.add(listenerBinding);
}
项目:guice    文件:ListenerBindingProcessor.java   
@Override
public Boolean visit(ProvisionListenerBinding binding) {
  injector.state.addProvisionListener(binding);
  return true;
}
项目:guice    文件:State.java   
@Override
public void addProvisionListener(ProvisionListenerBinding provisionListenerBinding) {
  throw new UnsupportedOperationException();
}
项目:guice    文件:State.java   
@Override
public List<ProvisionListenerBinding> getProvisionListenerBindings() {
  return ImmutableList.of();
}
项目:guice    文件:ProvisionListenerCallbackStore.java   
ProvisionListenerCallbackStore(List<ProvisionListenerBinding> listenerBindings) {
  this.listenerBindings = ImmutableList.copyOf(listenerBindings);
}
项目:guice    文件:WeakKeySetTest.java   
@Override
public void addProvisionListener(ProvisionListenerBinding provisionListenerBinding) {
  throw new UnsupportedOperationException();
}
项目:guice    文件:WeakKeySetTest.java   
@Override
public List<ProvisionListenerBinding> getProvisionListenerBindings() {
  return ImmutableList.of();
}
项目:guice-old    文件:InheritingState.java   
public void addProvisionListener(ProvisionListenerBinding listenerBinding) {
  provisionListenerBindings.add(listenerBinding);
}
项目:guice-old    文件:ListenerBindingProcessor.java   
@Override public Boolean visit(ProvisionListenerBinding binding) {
  injector.state.addProvisionListener(binding);
  return true;
}
项目:guice-old    文件:State.java   
public void addProvisionListener(ProvisionListenerBinding provisionListenerBinding) {
  throw new UnsupportedOperationException();
}
项目:guice-old    文件:State.java   
public List<ProvisionListenerBinding> getProvisionListenerBindings() {
  return ImmutableList.of();
}
项目:guice-old    文件:ProvisionListenerCallbackStore.java   
ProvisionListenerCallbackStore(List<ProvisionListenerBinding> listenerBindings) {
  this.listenerBindings = ImmutableList.copyOf(listenerBindings);
}
项目:guice-old    文件:WeakKeySetTest.java   
public void addProvisionListener(ProvisionListenerBinding provisionListenerBinding) {
  throw new UnsupportedOperationException();
}
项目:guice-old    文件:WeakKeySetTest.java   
public List<ProvisionListenerBinding> getProvisionListenerBindings() {
  return ImmutableList.of();
}
项目:google-guice    文件:InheritingState.java   
public void addProvisionListener(ProvisionListenerBinding listenerBinding) {
  provisionListenerBindings.add(listenerBinding);
}
项目:google-guice    文件:ListenerBindingProcessor.java   
@Override public Boolean visit(ProvisionListenerBinding binding) {
  injector.state.addProvisionListener(binding);
  return true;
}
项目:google-guice    文件:State.java   
public void addProvisionListener(ProvisionListenerBinding provisionListenerBinding) {
  throw new UnsupportedOperationException();
}
项目:google-guice    文件:State.java   
public List<ProvisionListenerBinding> getProvisionListenerBindings() {
  return ImmutableList.of();
}
项目:google-guice    文件:ProvisionListenerCallbackStore.java   
ProvisionListenerCallbackStore(List<ProvisionListenerBinding> listenerBindings) {
  this.listenerBindings = ImmutableList.copyOf(listenerBindings);
}
项目:guice    文件:State.java   
void addProvisionListener(ProvisionListenerBinding provisionListenerBinding);
项目:guice    文件:State.java   
List<ProvisionListenerBinding> getProvisionListenerBindings();
项目:guice-old    文件:State.java   
void addProvisionListener(ProvisionListenerBinding provisionListenerBinding);
项目:guice-old    文件:State.java   
List<ProvisionListenerBinding> getProvisionListenerBindings();
项目:google-guice    文件:State.java   
void addProvisionListener(ProvisionListenerBinding provisionListenerBinding);
项目:google-guice    文件:State.java   
List<ProvisionListenerBinding> getProvisionListenerBindings();