本文整理汇总了Java中com.google.gwt.inject.client.Ginjector类的典型用法代码示例。如果您正苦于以下问题:Java Ginjector类的具体用法?Java Ginjector怎么用?Java Ginjector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Ginjector类属于com.google.gwt.inject.client包,在下文中一共展示了Ginjector类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GinjectorBindings
import com.google.gwt.inject.client.Ginjector; //导入依赖的package包/类
@Inject
public GinjectorBindings(NameGenerator nameGenerator,
TreeLogger logger,
GuiceUtil guiceUtil,
@GinjectorInterfaceType Class<? extends Ginjector> ginjectorInterface,
Provider<GinjectorBindings> ginjectorBindingsProvider,
MemberCollector collector,
ErrorManager errorManager,
BindingResolver bindingResolver) {
this.nameGenerator = nameGenerator;
this.logger = logger;
this.guiceUtil = guiceUtil;
this.bindingResolver = bindingResolver;
this.ginjectorInterface = TypeLiteral.get(ginjectorInterface);
this.ginjectorBindingsProvider = ginjectorBindingsProvider;
this.errorManager = errorManager;
completeCollector = collector;
completeCollector.setMethodFilter(MemberCollector.ALL_METHOD_FILTER);
}
示例2: configure
import com.google.gwt.inject.client.Ginjector; //导入依赖的package包/类
@Override
protected void configure() {
install(new ResolutionModule());
install(new OutputModule());
bind(TreeLogger.class).toInstance(logger);
bind(GeneratorContext.class).toInstance(ctx);
bind(new TypeLiteral<Class<? extends Ginjector>>(){})
.annotatedWith(GinjectorInterfaceType.class)
.toInstance(ginjectorInterface);
bind(GinjectorBindings.class).annotatedWith(RootBindings.class)
.to(GinjectorBindings.class).in(Singleton.class);
bind(BindingIndex.class)
.to(Key.get(GinjectorBindings.class, RootBindings.class))
.in(Singleton.class);
install(new FactoryModuleBuilder()
.build(GuiceElementVisitor.GuiceElementVisitorFactory.class));
bind(new TypeLiteral<Set<Class<? extends GinModule>>>(){})
.annotatedWith(ModuleClasses.class)
.toInstance(moduleClasses);
bind(BindingFactory.class).to(BindingFactoryImpl.class);
install(new FactoryModuleBuilder()
.build(SourceWriteUtil.Factory.class));
}
示例3: getModuleClasses
import com.google.gwt.inject.client.Ginjector; //导入依赖的package包/类
private Set<Class<? extends GinModule>> getModuleClasses(Class<? extends Ginjector> ginjectorType) throws UnableToCompleteException {
Set<Class<? extends GinModule>> ginModules = new LinkedHashSet<Class<? extends GinModule>>();
getPropertyModuleClasses(ginjectorType, ginModules);
getModuleClassesFromInjectorInterface(ginjectorType, ginModules);
if (ginModules.isEmpty() && !ginjectorType.isAnnotationPresent(NoGinModules.class)) {
logger.log(TreeLogger.Type.WARN,
String.format("No gin modules are annotated on Ginjector %s, " + "did you forget the @GinModules annotation?", ginjectorType));
}
return ginModules;
}
示例4: getGinjectorType
import com.google.gwt.inject.client.Ginjector; //导入依赖的package包/类
@SuppressWarnings("unchecked")
// Due to deferred binding we assume that the requested class has to be a ginjector.
private Class<? extends Ginjector> getGinjectorType(String requestedClass)
throws ClassNotFoundException {
// We choose not to initialize ginjectors since we do not require it for reflective analysis and
// some people statically call GWT.create in them (which is illegal during Gin generator runs).
Class<?> type = loadClass(requestedClass, false);
if (!Ginjector.class.isAssignableFrom(type)) {
throw new IllegalArgumentException("The type passed does not inherit from Ginjector - "
+ "please check the deferred binding rules.");
}
return (Class<? extends Ginjector>) type;
}
示例5: BindingsProcessor
import com.google.gwt.inject.client.Ginjector; //导入依赖的package包/类
@Inject
BindingsProcessor(Provider<MemberCollector> collectorProvider,
@GinjectorInterfaceType Class<? extends Ginjector> ginjectorInterface,
ErrorManager errorManager,
@RootBindings GinjectorBindings rootGinjectorBindings,
GuiceElementVisitor.GuiceElementVisitorFactory guiceElementVisitorFactory,
BindingFactory bindingFactory,
@ModuleClasses Set<Class<? extends GinModule>> moduleClasses,
DoubleBindingChecker doubleBindingChecker) {
this.bindingFactory = bindingFactory;
this.moduleClasses = moduleClasses;
this.ginjectorInterface = TypeLiteral.get(ginjectorInterface);
this.errorManager = errorManager;
this.rootGinjectorBindings = rootGinjectorBindings;
this.guiceElementVisitorFactory = guiceElementVisitorFactory;
this.doubleBindingChecker = doubleBindingChecker;
completeCollector = collectorProvider.get();
completeCollector.setMethodFilter(MemberCollector.ALL_METHOD_FILTER);
}
示例6: getClassesToImport
import com.google.gwt.inject.client.Ginjector; //导入依赖的package包/类
String[] getClassesToImport() {
return new String[] { com.mvp4g.client.history.PlaceService.class.getName(),
GWT.class.getName(),
com.google.gwt.user.client.History.class.getName(),
ServiceDefTarget.class.getName(),
PresenterInterface.class.getName(),
EventBus.class.getName(),
Mvp4gException.class.getName(),
HistoryConverter.class.getName(),
Mvp4gEventPasser.class.getName(),
Mvp4gModule.class.getName(),
GinModules.class.getName(),
Ginjector.class.getName(),
BaseEventBus.class.getName(),
EventFilter.class.getName(),
EventHandlerInterface.class.getName(),
List.class.getName(),
NavigationEventCommand.class.getName(),
NavigationConfirmationInterface.class.getName(),
RunAsyncCallback.class.getName(),
Mvp4gRunAsync.class.getName(),
Command.class.getName(),
HistoryProxyProvider.class.getName(),
DefaultHistoryProxy.class.getName() };
}
示例7: getGinjectorType
import com.google.gwt.inject.client.Ginjector; //导入依赖的package包/类
@SuppressWarnings("unchecked")
// Due to deferred binding we assume that the requested class has to be a ginjector.
private Class<? extends Ginjector> getGinjectorType(String requestedClass) throws ClassNotFoundException {
// We choose not to initialize ginjectors since we do not require it for reflective analysis and
// some people statically call GWT.create in them (which is illegal during Gin generator runs).
Class<?> type = loadClass(requestedClass, false);
if (!Ginjector.class.isAssignableFrom(type)) {
throw new IllegalArgumentException("The type passed does not inherit from Ginjector - " + "please check the deferred binding rules.");
}
return (Class<? extends Ginjector>) type;
}
示例8: getModuleClasses
import com.google.gwt.inject.client.Ginjector; //导入依赖的package包/类
private Set<Class<? extends GinModule>> getModuleClasses(Class<? extends Ginjector> ginjectorType)
throws UnableToCompleteException {
Set<Class<? extends GinModule>> ginModules = new LinkedHashSet<Class<? extends GinModule>>();
getPropertyModuleClasses(ginjectorType, ginModules);
getModuleClassesFromInjectorInterface(ginjectorType, ginModules);
if (ginModules.isEmpty() && !ginjectorType.isAnnotationPresent(NoGinModules.class)) {
logger.log(TreeLogger.Type.WARN,
String.format("No gin modules are annotated on Ginjector %s, "
+ "did you forget the @GinModules annotation?", ginjectorType));
}
return ginModules;
}
示例9: GinjectorGeneratorModule
import com.google.gwt.inject.client.Ginjector; //导入依赖的package包/类
public GinjectorGeneratorModule(TreeLogger logger, GeneratorContext ctx,
Class<? extends Ginjector> ginjectorInterface,
Set<Class<? extends GinModule>> moduleClasses) {
this.logger = logger;
this.ctx = ctx;
this.ginjectorInterface = ginjectorInterface;
this.moduleClasses = moduleClasses;
}
示例10: BindingFactoryImpl
import com.google.gwt.inject.client.Ginjector; //导入依赖的package包/类
@Inject
public BindingFactoryImpl(
ErrorManager errorManager,
GuiceUtil guiceUtil,
@GinjectorInterfaceType Class<? extends Ginjector> ginjectorInterface,
MethodCallUtil methodCallUtil) {
this.errorManager = errorManager;
this.guiceUtil = guiceUtil;
this.ginjectorInterface = ginjectorInterface;
this.methodCallUtil = methodCallUtil;
}
示例11: GinjectorBinding
import com.google.gwt.inject.client.Ginjector; //导入依赖的package包/类
@Inject
public GinjectorBinding(@GinjectorInterfaceType Class<? extends Ginjector> ginjectorInterface) {
// This message is used to generate double-binding errors. We output a very
// specific message, because people were confused and tried to bind their
// Ginjectors manually.
//
// TODO(dburrows): probably it's better to explicitly error if the user
// manually binds the ginjector, instead of relying on the double-binding
// check to catch it.
super(Context.format("Automatic binding for %s; you should not need to bind this manually.",
ginjectorInterface), TypeLiteral.get(ginjectorInterface));
this.ginjectorInterface = ginjectorInterface;
}
示例12: createGinjector
import com.google.gwt.inject.client.Ginjector; //导入依赖的package包/类
private String createGinjector(TreeLogger logger, GeneratorContext context, String packageName,
String requestedName, String newClassName, String moduleName) {
String ginjectorName = requestedName + "Ginjector";
ClassSourceFileComposerFactory ginjectorFactory =
new ClassSourceFileComposerFactory(packageName, ginjectorName);
ginjectorFactory.makeInterface();
ginjectorFactory.addImplementedInterface(Ginjector.class.getCanonicalName());
ginjectorFactory.addImport(GinModules.class.getCanonicalName());
ginjectorFactory.addAnnotationDeclaration("@GinModules(" + moduleName + ".class)");
SourceWriter ginjectorWriter = ginjectorFactory.createSourceWriter(context,
context.tryCreate(logger, packageName, ginjectorName));
ginjectorWriter.println("void injectMembers(" + newClassName + " obj);");
ginjectorWriter.commit(logger);
return ginjectorName;
}
示例13: GinjectorNameGenerator
import com.google.gwt.inject.client.Ginjector; //导入依赖的package包/类
@Inject
GinjectorNameGenerator(@GinjectorInterfaceType Class<? extends Ginjector> ginjectorInterface) {
this.ginjectorInterface = ginjectorInterface;
}
示例14: FragmentPackageName
import com.google.gwt.inject.client.Ginjector; //导入依赖的package包/类
@Inject
FragmentPackageName(@GinjectorInterfaceType Class<? extends Ginjector> ginjectorInterface,
@Assisted String requestedName) {
name = sanitizePackageName(ginjectorInterface, requestedName);
}
示例15: registerGinjectorBinding
import com.google.gwt.inject.client.Ginjector; //导入依赖的package包/类
/**
* Create an explicit binding for the Ginjector.
*/
private void registerGinjectorBinding() {
Key<? extends Ginjector> ginjectorKey = Key.get(ginjectorInterface);
rootGinjectorBindings.addBinding(ginjectorKey, bindingFactory.getGinjectorBinding());
}