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

项目:guice    文件:Modules.java   
private static Module extractScanners(Iterable<Element> elements) {
  final List<ModuleAnnotatedMethodScannerBinding> scanners = Lists.newArrayList();
  ElementVisitor<Void> visitor =
      new DefaultElementVisitor<Void>() {
        @Override
        public Void visit(ModuleAnnotatedMethodScannerBinding binding) {
          scanners.add(binding);
          return null;
        }
      };
  for (Element element : elements) {
    element.acceptVisitor(visitor);
  }
  return new AbstractModule() {
    @Override
    protected void configure() {
      for (ModuleAnnotatedMethodScannerBinding scanner : scanners) {
        scanner.applyTo(binder());
      }
    }
  };
}
项目:ProjectAres    文件:ElementUtils.java   
public static List<Element> visit(ElementVisitor<?> visitor, Iterable<? extends Module> modules) {
    final List<Element> elements = Elements.getElements(Stage.TOOL, modules);
    elements.forEach(e -> e.acceptVisitor(visitor));
    return elements;
}
项目:ProjectAres    文件:ElementUtils.java   
public static List<Element> visit(ElementVisitor<?> visitor, Module... modules) {
    return visit(visitor, Arrays.asList(modules));
}
项目:guice    文件:PrivateElementsImpl.java   
@Override
public <T> T acceptVisitor(ElementVisitor<T> visitor) {
  return visitor.visit(this);
}
项目:guice    文件:BindingImpl.java   
@Override
public <V> V acceptVisitor(ElementVisitor<V> visitor) {
  return visitor.visit(this);
}
项目:guice    文件:NoopOverrideTest.java   
@Override
protected void checkModule(Module module, ElementVisitor<?>... visitors) {
  Module overridden = Modules.override(module).with(Modules.EMPTY_MODULE);
  super.checkModule(overridden, visitors);
}
项目:guice-old    文件:PrivateElementsImpl.java   
public <T> T acceptVisitor(ElementVisitor<T> visitor) {
  return visitor.visit(this);
}
项目:guice-old    文件:BindingImpl.java   
public <V> V acceptVisitor(ElementVisitor<V> visitor) {
  return visitor.visit(this);
}
项目:guice-old    文件:NoopOverrideTest.java   
protected void checkModule(Module module, ElementVisitor<?>... visitors) {
  Module overridden = Modules.override(module).with(Modules.EMPTY_MODULE);
  super.checkModule(overridden, visitors);
}
项目:google-guice    文件:PrivateElementsImpl.java   
public <T> T acceptVisitor(ElementVisitor<T> visitor) {
  return visitor.visit(this);
}
项目:google-guice    文件:BindingImpl.java   
public <V> V acceptVisitor(ElementVisitor<V> visitor) {
  return visitor.visit(this);
}
项目:google-guice    文件:NoopOverrideTest.java   
protected void checkModule(Module module, ElementVisitor<?>... visitors) {
  Module overridden = Modules.override(module).with(Modules.EMPTY_MODULE);
  super.checkModule(overridden, visitors);
}