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

项目:guice    文件:MultibindingsScanner.java   
/**
 * @deprecated This method returns an empty scanner since the preexisting functionality is
 *     installed by default.
 */
@Deprecated
public static ModuleAnnotatedMethodScanner scanner() {
  return new ModuleAnnotatedMethodScanner() {
    @Override
    public Set<? extends Class<? extends Annotation>> annotationClasses() {
      return ImmutableSet.of();
    }

    @Override
    public <T> Key<T> prepareMethod(
        Binder binder, Annotation annotation, Key<T> key, InjectionPoint injectionPoint) {
      throw new IllegalStateException("Unexpected annotation: " + annotation);
    }
  };
}
项目:guice    文件:ProviderMethodsModule.java   
private ProviderMethodsModule(
    Object delegate, boolean skipFastClassGeneration, ModuleAnnotatedMethodScanner scanner) {
  this.delegate = checkNotNull(delegate, "delegate");
  this.typeLiteral = TypeLiteral.get(this.delegate.getClass());
  this.skipFastClassGeneration = skipFastClassGeneration;
  this.scanner = scanner;
}
项目:guice    文件:ProviderMethodsModule.java   
private static Module forObject(
    Object object, boolean skipFastClassGeneration, ModuleAnnotatedMethodScanner scanner) {
  // avoid infinite recursion, since installing a module always installs itself
  if (object instanceof ProviderMethodsModule) {
    return Modules.EMPTY_MODULE;
  }

  return new ProviderMethodsModule(object, skipFastClassGeneration, scanner);
}
项目:violet    文件:ForwardingBinder.java   
@Override
default void scanModulesForAnnotatedMethods(final ModuleAnnotatedMethodScanner scanner) {
  this.binder().scanModulesForAnnotatedMethods(scanner);
}
项目:guice    文件:ProviderMethodsModule.java   
/** Returns a module which creates bindings methods in the module that match the scanner. */
public static Module forModule(Object module, ModuleAnnotatedMethodScanner scanner) {
  return forObject(module, false, scanner);
}
项目:guice    文件:Binder.java   
/**
 * Adds a scanner that will look in all installed modules for annotations the scanner can parse,
 * and binds them like {@literal @}Provides methods. Scanners apply to all modules installed in
 * the injector. Scanners installed in child injectors or private modules do not impact modules in
 * siblings or parents, however scanners installed in parents do apply to all child injectors and
 * private modules.
 *
 * @since 4.0
 */
void scanModulesForAnnotatedMethods(ModuleAnnotatedMethodScanner scanner);