001 /* 002 * Copyright 2010-2013 JetBrains s.r.o. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017 package org.jetbrains.jet.di; 018 019 import com.intellij.openapi.project.Project; 020 import org.jetbrains.jet.lang.resolve.lazy.ResolveSession; 021 import org.jetbrains.jet.lang.descriptors.ModuleDescriptor; 022 import org.jetbrains.jet.lang.resolve.DescriptorResolver; 023 import org.jetbrains.jet.lang.types.expressions.ExpressionTypingServices; 024 import org.jetbrains.jet.lang.resolve.TypeResolver; 025 import org.jetbrains.jet.lang.resolve.lazy.ScopeProvider; 026 import org.jetbrains.jet.lang.resolve.AnnotationResolver; 027 import org.jetbrains.jet.lang.resolve.QualifiedExpressionResolver; 028 import org.jetbrains.jet.lang.psi.JetImportsFactory; 029 import org.jetbrains.jet.lang.resolve.calls.CallResolverExtensionProvider; 030 import org.jetbrains.jet.lang.PlatformToKotlinClassMap; 031 import org.jetbrains.jet.lang.resolve.DelegatedPropertyResolver; 032 import org.jetbrains.jet.lang.resolve.calls.CallExpressionResolver; 033 import org.jetbrains.jet.lang.resolve.calls.CallResolver; 034 import org.jetbrains.jet.lang.resolve.calls.ArgumentTypeResolver; 035 import org.jetbrains.jet.lang.resolve.calls.CandidateResolver; 036 import org.jetbrains.annotations.NotNull; 037 import javax.annotation.PreDestroy; 038 039 /* This file is generated by org.jetbrains.jet.generators.injectors.GenerateInjectors. DO NOT EDIT! */ 040 public class InjectorForLazyResolve { 041 042 private final Project project; 043 private final ResolveSession resolveSession; 044 private final ModuleDescriptor moduleDescriptor; 045 private final DescriptorResolver descriptorResolver; 046 private final ExpressionTypingServices expressionTypingServices; 047 private final TypeResolver typeResolver; 048 private final ScopeProvider scopeProvider; 049 private final AnnotationResolver annotationResolver; 050 private final QualifiedExpressionResolver qualifiedExpressionResolver; 051 private final JetImportsFactory jetImportsFactory; 052 private final CallResolverExtensionProvider callResolverExtensionProvider; 053 private final PlatformToKotlinClassMap platformToKotlinClassMap; 054 private final DelegatedPropertyResolver delegatedPropertyResolver; 055 private final CallExpressionResolver callExpressionResolver; 056 private final CallResolver callResolver; 057 private final ArgumentTypeResolver argumentTypeResolver; 058 private final CandidateResolver candidateResolver; 059 060 public InjectorForLazyResolve( 061 @NotNull Project project, 062 @NotNull ResolveSession resolveSession, 063 @NotNull ModuleDescriptor moduleDescriptor 064 ) { 065 this.project = project; 066 this.resolveSession = resolveSession; 067 this.moduleDescriptor = moduleDescriptor; 068 this.descriptorResolver = new DescriptorResolver(); 069 this.expressionTypingServices = new ExpressionTypingServices(); 070 this.typeResolver = new TypeResolver(); 071 this.scopeProvider = new ScopeProvider(resolveSession); 072 this.annotationResolver = new AnnotationResolver(); 073 this.qualifiedExpressionResolver = new QualifiedExpressionResolver(); 074 this.jetImportsFactory = new JetImportsFactory(); 075 this.callResolverExtensionProvider = new CallResolverExtensionProvider(); 076 this.platformToKotlinClassMap = moduleDescriptor.getPlatformToKotlinClassMap(); 077 this.delegatedPropertyResolver = new DelegatedPropertyResolver(); 078 this.callExpressionResolver = new CallExpressionResolver(); 079 this.callResolver = new CallResolver(); 080 this.argumentTypeResolver = new ArgumentTypeResolver(); 081 this.candidateResolver = new CandidateResolver(); 082 083 this.descriptorResolver.setAnnotationResolver(annotationResolver); 084 this.descriptorResolver.setDelegatedPropertyResolver(delegatedPropertyResolver); 085 this.descriptorResolver.setExpressionTypingServices(expressionTypingServices); 086 this.descriptorResolver.setTypeResolver(typeResolver); 087 088 this.expressionTypingServices.setAnnotationResolver(annotationResolver); 089 this.expressionTypingServices.setCallExpressionResolver(callExpressionResolver); 090 this.expressionTypingServices.setCallResolver(callResolver); 091 this.expressionTypingServices.setDescriptorResolver(descriptorResolver); 092 this.expressionTypingServices.setExtensionProvider(callResolverExtensionProvider); 093 this.expressionTypingServices.setPlatformToKotlinClassMap(platformToKotlinClassMap); 094 this.expressionTypingServices.setProject(project); 095 this.expressionTypingServices.setTypeResolver(typeResolver); 096 097 this.typeResolver.setAnnotationResolver(annotationResolver); 098 this.typeResolver.setModuleDescriptor(moduleDescriptor); 099 this.typeResolver.setQualifiedExpressionResolver(qualifiedExpressionResolver); 100 101 this.annotationResolver.setCallResolver(callResolver); 102 this.annotationResolver.setExpressionTypingServices(expressionTypingServices); 103 104 this.jetImportsFactory.setProject(project); 105 106 delegatedPropertyResolver.setExpressionTypingServices(expressionTypingServices); 107 108 callExpressionResolver.setExpressionTypingServices(expressionTypingServices); 109 110 callResolver.setArgumentTypeResolver(argumentTypeResolver); 111 callResolver.setCandidateResolver(candidateResolver); 112 callResolver.setExpressionTypingServices(expressionTypingServices); 113 callResolver.setTypeResolver(typeResolver); 114 115 argumentTypeResolver.setExpressionTypingServices(expressionTypingServices); 116 argumentTypeResolver.setTypeResolver(typeResolver); 117 118 candidateResolver.setArgumentTypeResolver(argumentTypeResolver); 119 120 } 121 122 @PreDestroy 123 public void destroy() { 124 } 125 126 public DescriptorResolver getDescriptorResolver() { 127 return this.descriptorResolver; 128 } 129 130 public ExpressionTypingServices getExpressionTypingServices() { 131 return this.expressionTypingServices; 132 } 133 134 public TypeResolver getTypeResolver() { 135 return this.typeResolver; 136 } 137 138 public ScopeProvider getScopeProvider() { 139 return this.scopeProvider; 140 } 141 142 public AnnotationResolver getAnnotationResolver() { 143 return this.annotationResolver; 144 } 145 146 public QualifiedExpressionResolver getQualifiedExpressionResolver() { 147 return this.qualifiedExpressionResolver; 148 } 149 150 public JetImportsFactory getJetImportsFactory() { 151 return this.jetImportsFactory; 152 } 153 154 }