Search in sources :

Example 1 with Factory

use of dagger.internal.Factory in project GreenHouse by utsanjan.

the class DaggerTransportRuntimeComponent method initialize.

private void initialize(Context setApplicationContextParam) {
    this.executorProvider = DoubleCheck.provider(ExecutionModule_ExecutorFactory.create());
    Factory create = InstanceFactory.create(setApplicationContextParam);
    this.setApplicationContextProvider = create;
    CreationContextFactory_Factory create2 = CreationContextFactory_Factory.create(create, TimeModule_EventClockFactory.create(), TimeModule_UptimeClockFactory.create());
    this.creationContextFactoryProvider = create2;
    this.metadataBackendRegistryProvider = DoubleCheck.provider(MetadataBackendRegistry_Factory.create(this.setApplicationContextProvider, create2));
    this.schemaManagerProvider = SchemaManager_Factory.create(this.setApplicationContextProvider, EventStoreModule_DbNameFactory.create(), EventStoreModule_SchemaVersionFactory.create());
    this.sQLiteEventStoreProvider = DoubleCheck.provider(SQLiteEventStore_Factory.create(TimeModule_EventClockFactory.create(), TimeModule_UptimeClockFactory.create(), EventStoreModule_StoreConfigFactory.create(), this.schemaManagerProvider));
    SchedulingConfigModule_ConfigFactory create3 = SchedulingConfigModule_ConfigFactory.create(TimeModule_EventClockFactory.create());
    this.configProvider = create3;
    SchedulingModule_WorkSchedulerFactory create4 = SchedulingModule_WorkSchedulerFactory.create(this.setApplicationContextProvider, this.sQLiteEventStoreProvider, create3, TimeModule_UptimeClockFactory.create());
    this.workSchedulerProvider = create4;
    Provider<Executor> provider = this.executorProvider;
    Provider provider2 = this.metadataBackendRegistryProvider;
    Provider<SQLiteEventStore> provider3 = this.sQLiteEventStoreProvider;
    this.defaultSchedulerProvider = DefaultScheduler_Factory.create(provider, provider2, create4, provider3, provider3);
    Provider<Context> provider4 = this.setApplicationContextProvider;
    Provider provider5 = this.metadataBackendRegistryProvider;
    Provider<SQLiteEventStore> provider6 = this.sQLiteEventStoreProvider;
    this.uploaderProvider = Uploader_Factory.create(provider4, provider5, provider6, this.workSchedulerProvider, this.executorProvider, provider6, TimeModule_EventClockFactory.create());
    Provider<Executor> provider7 = this.executorProvider;
    Provider<SQLiteEventStore> provider8 = this.sQLiteEventStoreProvider;
    this.workInitializerProvider = WorkInitializer_Factory.create(provider7, provider8, this.workSchedulerProvider, provider8);
    this.transportRuntimeProvider = DoubleCheck.provider(TransportRuntime_Factory.create(TimeModule_EventClockFactory.create(), TimeModule_UptimeClockFactory.create(), this.defaultSchedulerProvider, this.uploaderProvider, this.workInitializerProvider));
}
Also used : Context(android.content.Context) Executor(java.util.concurrent.Executor) SQLiteEventStore(com.google.android.datatransport.runtime.scheduling.persistence.SQLiteEventStore) WorkInitializer_Factory(com.google.android.datatransport.runtime.scheduling.jobscheduling.WorkInitializer_Factory) SchemaManager_Factory(com.google.android.datatransport.runtime.scheduling.persistence.SchemaManager_Factory) CreationContextFactory_Factory(com.google.android.datatransport.runtime.backends.CreationContextFactory_Factory) TimeModule_UptimeClockFactory(com.google.android.datatransport.runtime.time.TimeModule_UptimeClockFactory) EventStoreModule_DbNameFactory(com.google.android.datatransport.runtime.scheduling.persistence.EventStoreModule_DbNameFactory) DefaultScheduler_Factory(com.google.android.datatransport.runtime.scheduling.DefaultScheduler_Factory) SchedulingModule_WorkSchedulerFactory(com.google.android.datatransport.runtime.scheduling.SchedulingModule_WorkSchedulerFactory) EventStoreModule_SchemaVersionFactory(com.google.android.datatransport.runtime.scheduling.persistence.EventStoreModule_SchemaVersionFactory) EventStoreModule_StoreConfigFactory(com.google.android.datatransport.runtime.scheduling.persistence.EventStoreModule_StoreConfigFactory) InstanceFactory(dagger.internal.InstanceFactory) SchedulingConfigModule_ConfigFactory(com.google.android.datatransport.runtime.scheduling.SchedulingConfigModule_ConfigFactory) Uploader_Factory(com.google.android.datatransport.runtime.scheduling.jobscheduling.Uploader_Factory) SQLiteEventStore_Factory(com.google.android.datatransport.runtime.scheduling.persistence.SQLiteEventStore_Factory) TimeModule_EventClockFactory(com.google.android.datatransport.runtime.time.TimeModule_EventClockFactory) MetadataBackendRegistry_Factory(com.google.android.datatransport.runtime.backends.MetadataBackendRegistry_Factory) Factory(dagger.internal.Factory) CreationContextFactory_Factory(com.google.android.datatransport.runtime.backends.CreationContextFactory_Factory) SchedulingConfigModule_ConfigFactory(com.google.android.datatransport.runtime.scheduling.SchedulingConfigModule_ConfigFactory) SchedulingModule_WorkSchedulerFactory(com.google.android.datatransport.runtime.scheduling.SchedulingModule_WorkSchedulerFactory) Provider(javax.inject.Provider)

Example 2 with Factory

use of dagger.internal.Factory in project DaggerCodeParse-2.38.1base by hellogaod.

the class FactoryGenerator method frameworkFields.

// 绑定的依赖参数生成变量类型,并且该参数是根据依赖kind类型决定一个框架类型包裹该参数实际类型,例如如果参数是T,当前绑定使用了Provides修饰,那么这里的变量类型是Provider<T>
// 还做了防止和module参数命名冲突处理
private ImmutableMap<DependencyRequest, FieldSpec> frameworkFields(ProvisionBinding binding) {
    UniqueNameSet uniqueFieldNames = new UniqueNameSet();
    // TODO(bcorso, dpb): Add a test for the case when a Factory parameter is named "module".
    moduleParameter(binding).ifPresent(module -> uniqueFieldNames.claim(module.name));
    return ImmutableMap.copyOf(transformValues(generateBindingFieldsForDependencies(binding), field -> FieldSpec.builder(field.type(), uniqueFieldNames.getUniqueName(field.name()), PRIVATE, FINAL).build()));
}
Also used : SINGLETON_INSTANCE(dagger.internal.codegen.binding.ContributionBinding.FactoryCreationStrategy.SINGLETON_INSTANCE) DELEGATE(dagger.internal.codegen.binding.ContributionBinding.FactoryCreationStrategy.DELEGATE) SourceFiles.generateBindingFieldsForDependencies(dagger.internal.codegen.binding.SourceFiles.generateBindingFieldsForDependencies) SourceFiles.generatedClassNameForBinding(dagger.internal.codegen.binding.SourceFiles.generatedClassNameForBinding) ClassName(com.squareup.javapoet.ClassName) Maps.transformValues(com.google.common.collect.Maps.transformValues) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) DependencyRequest(dagger.spi.model.DependencyRequest) INJECTION(dagger.spi.model.BindingKind.INJECTION) FINAL(javax.lang.model.element.Modifier.FINAL) Map(java.util.Map) DaggerTypes(dagger.internal.codegen.langmodel.DaggerTypes) ParameterSpec(com.squareup.javapoet.ParameterSpec) ImmutableMap(com.google.common.collect.ImmutableMap) DaggerStreams.toImmutableList(dagger.internal.codegen.extension.DaggerStreams.toImmutableList) MethodSpec.constructorBuilder(com.squareup.javapoet.MethodSpec.constructorBuilder) Element(javax.lang.model.element.Element) TypeNames.factoryOf(dagger.internal.codegen.javapoet.TypeNames.factoryOf) SourceVersion(javax.lang.model.SourceVersion) List(java.util.List) TypeName(com.squareup.javapoet.TypeName) Optional(java.util.Optional) SourceFiles.frameworkFieldUsages(dagger.internal.codegen.binding.SourceFiles.frameworkFieldUsages) KotlinMetadataUtil(dagger.internal.codegen.kotlin.KotlinMetadataUtil) SourceFileGenerator(dagger.internal.codegen.base.SourceFileGenerator) CodeBlocks(dagger.internal.codegen.javapoet.CodeBlocks) FieldSpec(com.squareup.javapoet.FieldSpec) GwtCompatibility.gwtIncompatibleAnnotation(dagger.internal.codegen.writing.GwtCompatibility.gwtIncompatibleAnnotation) VariableElement(javax.lang.model.element.VariableElement) ContributionBinding(dagger.internal.codegen.binding.ContributionBinding) AssistedInjectionAnnotations.assistedParameters(dagger.internal.codegen.binding.AssistedInjectionAnnotations.assistedParameters) SourceFiles.bindingTypeElementTypeVariableNames(dagger.internal.codegen.binding.SourceFiles.bindingTypeElementTypeVariableNames) Inject(javax.inject.Inject) DaggerElements(dagger.internal.codegen.langmodel.DaggerElements) Lists(com.google.common.collect.Lists) ImmutableList(com.google.common.collect.ImmutableList) XFiler(androidx.room.compiler.processing.XFiler) TypeSpec.classBuilder(com.squareup.javapoet.TypeSpec.classBuilder) BindingKind(dagger.spi.model.BindingKind) ProvisionBinding(dagger.internal.codegen.binding.ProvisionBinding) UNCHECKED(dagger.internal.codegen.javapoet.AnnotationSpecs.Suppression.UNCHECKED) CompilerOptions(dagger.internal.codegen.compileroption.CompilerOptions) CodeBlock(com.squareup.javapoet.CodeBlock) TypeVariableName(com.squareup.javapoet.TypeVariableName) DaggerStreams.toImmutableMap(dagger.internal.codegen.extension.DaggerStreams.toImmutableMap) RAWTYPES(dagger.internal.codegen.javapoet.AnnotationSpecs.Suppression.RAWTYPES) PRIVATE(javax.lang.model.element.Modifier.PRIVATE) MethodSpec(com.squareup.javapoet.MethodSpec) SourceFiles.frameworkTypeUsageStatement(dagger.internal.codegen.binding.SourceFiles.frameworkTypeUsageStatement) SourceFiles.parameterizedGeneratedTypeNameForBinding(dagger.internal.codegen.binding.SourceFiles.parameterizedGeneratedTypeNameForBinding) PUBLIC(javax.lang.model.element.Modifier.PUBLIC) TypeSpec(com.squareup.javapoet.TypeSpec) Binding(dagger.internal.codegen.binding.Binding) TypeParameterElement(javax.lang.model.element.TypeParameterElement) PROVISION(dagger.spi.model.BindingKind.PROVISION) STATIC(javax.lang.model.element.Modifier.STATIC) UniqueNameSet(dagger.internal.codegen.base.UniqueNameSet) CodeBlocks.makeParametersCodeBlock(dagger.internal.codegen.javapoet.CodeBlocks.makeParametersCodeBlock) MethodSpec.methodBuilder(com.squareup.javapoet.MethodSpec.methodBuilder) AnnotationSpecs.suppressWarnings(dagger.internal.codegen.javapoet.AnnotationSpecs.suppressWarnings) ASSISTED_INJECTION(dagger.spi.model.BindingKind.ASSISTED_INJECTION) Factory(dagger.internal.Factory) UniqueNameSet(dagger.internal.codegen.base.UniqueNameSet)

Aggregations

Factory (dagger.internal.Factory)2 Context (android.content.Context)1 XFiler (androidx.room.compiler.processing.XFiler)1 CreationContextFactory_Factory (com.google.android.datatransport.runtime.backends.CreationContextFactory_Factory)1 MetadataBackendRegistry_Factory (com.google.android.datatransport.runtime.backends.MetadataBackendRegistry_Factory)1 DefaultScheduler_Factory (com.google.android.datatransport.runtime.scheduling.DefaultScheduler_Factory)1 SchedulingConfigModule_ConfigFactory (com.google.android.datatransport.runtime.scheduling.SchedulingConfigModule_ConfigFactory)1 SchedulingModule_WorkSchedulerFactory (com.google.android.datatransport.runtime.scheduling.SchedulingModule_WorkSchedulerFactory)1 Uploader_Factory (com.google.android.datatransport.runtime.scheduling.jobscheduling.Uploader_Factory)1 WorkInitializer_Factory (com.google.android.datatransport.runtime.scheduling.jobscheduling.WorkInitializer_Factory)1 EventStoreModule_DbNameFactory (com.google.android.datatransport.runtime.scheduling.persistence.EventStoreModule_DbNameFactory)1 EventStoreModule_SchemaVersionFactory (com.google.android.datatransport.runtime.scheduling.persistence.EventStoreModule_SchemaVersionFactory)1 EventStoreModule_StoreConfigFactory (com.google.android.datatransport.runtime.scheduling.persistence.EventStoreModule_StoreConfigFactory)1 SQLiteEventStore (com.google.android.datatransport.runtime.scheduling.persistence.SQLiteEventStore)1 SQLiteEventStore_Factory (com.google.android.datatransport.runtime.scheduling.persistence.SQLiteEventStore_Factory)1 SchemaManager_Factory (com.google.android.datatransport.runtime.scheduling.persistence.SchemaManager_Factory)1 TimeModule_EventClockFactory (com.google.android.datatransport.runtime.time.TimeModule_EventClockFactory)1 TimeModule_UptimeClockFactory (com.google.android.datatransport.runtime.time.TimeModule_UptimeClockFactory)1 Preconditions.checkArgument (com.google.common.base.Preconditions.checkArgument)1 ImmutableList (com.google.common.collect.ImmutableList)1