本文整理汇总了Java中com.google.inject.spi.ModuleAnnotatedMethodScanner类的典型用法代码示例。如果您正苦于以下问题:Java ModuleAnnotatedMethodScanner类的具体用法?Java ModuleAnnotatedMethodScanner怎么用?Java ModuleAnnotatedMethodScanner使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ModuleAnnotatedMethodScanner类属于com.google.inject.spi包,在下文中一共展示了ModuleAnnotatedMethodScanner类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: scanner
import com.google.inject.spi.ModuleAnnotatedMethodScanner; //导入依赖的package包/类
/**
* @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);
}
};
}
示例2: ProviderMethodsModule
import com.google.inject.spi.ModuleAnnotatedMethodScanner; //导入依赖的package包/类
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;
}
示例3: forObject
import com.google.inject.spi.ModuleAnnotatedMethodScanner; //导入依赖的package包/类
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);
}
示例4: scanModulesForAnnotatedMethods
import com.google.inject.spi.ModuleAnnotatedMethodScanner; //导入依赖的package包/类
@Override
default void scanModulesForAnnotatedMethods(final ModuleAnnotatedMethodScanner scanner) {
this.binder().scanModulesForAnnotatedMethods(scanner);
}
示例5: forModule
import com.google.inject.spi.ModuleAnnotatedMethodScanner; //导入依赖的package包/类
/** 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);
}
示例6: scanModulesForAnnotatedMethods
import com.google.inject.spi.ModuleAnnotatedMethodScanner; //导入依赖的package包/类
/**
* 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);