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.NeedSyntheticCallResolverExtension; 030 import org.jetbrains.jet.lang.PlatformToKotlinClassMap; 031 import org.jetbrains.jet.lang.resolve.calls.CallExpressionResolver; 032 import org.jetbrains.jet.lang.resolve.calls.CallResolver; 033 import org.jetbrains.jet.lang.resolve.calls.ArgumentTypeResolver; 034 import org.jetbrains.jet.lang.resolve.calls.CandidateResolver; 035 import org.jetbrains.annotations.NotNull; 036 import javax.annotation.PreDestroy; 037 038 /* This file is generated by org.jetbrains.jet.generators.injectors.GenerateInjectors. DO NOT EDIT! */ 039 public class InjectorForLazyResolve { 040 041 private final Project project; 042 private final ResolveSession resolveSession; 043 private final ModuleDescriptor moduleDescriptor; 044 private final DescriptorResolver descriptorResolver; 045 private final ExpressionTypingServices expressionTypingServices; 046 private final TypeResolver typeResolver; 047 private final ScopeProvider scopeProvider; 048 private final AnnotationResolver annotationResolver; 049 private final QualifiedExpressionResolver qualifiedExpressionResolver; 050 private final JetImportsFactory jetImportsFactory; 051 private final NeedSyntheticCallResolverExtension needSyntheticCallResolverExtension; 052 private final PlatformToKotlinClassMap platformToKotlinClassMap; 053 private final CallExpressionResolver callExpressionResolver; 054 private final CallResolver callResolver; 055 private final ArgumentTypeResolver argumentTypeResolver; 056 private final CandidateResolver candidateResolver; 057 058 public InjectorForLazyResolve( 059 @NotNull Project project, 060 @NotNull ResolveSession resolveSession, 061 @NotNull ModuleDescriptor moduleDescriptor 062 ) { 063 this.project = project; 064 this.resolveSession = resolveSession; 065 this.moduleDescriptor = moduleDescriptor; 066 this.descriptorResolver = new DescriptorResolver(); 067 this.expressionTypingServices = new ExpressionTypingServices(); 068 this.typeResolver = new TypeResolver(); 069 this.scopeProvider = new ScopeProvider(resolveSession); 070 this.annotationResolver = new AnnotationResolver(); 071 this.qualifiedExpressionResolver = new QualifiedExpressionResolver(); 072 this.jetImportsFactory = new JetImportsFactory(); 073 this.needSyntheticCallResolverExtension = new NeedSyntheticCallResolverExtension(); 074 this.platformToKotlinClassMap = moduleDescriptor.getPlatformToKotlinClassMap(); 075 this.callExpressionResolver = new CallExpressionResolver(); 076 this.callResolver = new CallResolver(); 077 this.argumentTypeResolver = new ArgumentTypeResolver(); 078 this.candidateResolver = new CandidateResolver(); 079 080 this.descriptorResolver.setAnnotationResolver(annotationResolver); 081 this.descriptorResolver.setExpressionTypingServices(expressionTypingServices); 082 this.descriptorResolver.setTypeResolver(typeResolver); 083 084 this.expressionTypingServices.setAnnotationResolver(annotationResolver); 085 this.expressionTypingServices.setCallExpressionResolver(callExpressionResolver); 086 this.expressionTypingServices.setCallResolver(callResolver); 087 this.expressionTypingServices.setDescriptorResolver(descriptorResolver); 088 this.expressionTypingServices.setPlatformToKotlinClassMap(platformToKotlinClassMap); 089 this.expressionTypingServices.setProject(project); 090 this.expressionTypingServices.setTypeResolver(typeResolver); 091 092 this.typeResolver.setAnnotationResolver(annotationResolver); 093 this.typeResolver.setModuleDescriptor(moduleDescriptor); 094 this.typeResolver.setQualifiedExpressionResolver(qualifiedExpressionResolver); 095 096 this.annotationResolver.setCallResolver(callResolver); 097 this.annotationResolver.setExpressionTypingServices(expressionTypingServices); 098 099 this.jetImportsFactory.setProject(project); 100 101 callExpressionResolver.setExpressionTypingServices(expressionTypingServices); 102 103 callResolver.setArgumentTypeResolver(argumentTypeResolver); 104 callResolver.setCandidateResolver(candidateResolver); 105 callResolver.setExpressionTypingServices(expressionTypingServices); 106 callResolver.setExtension(needSyntheticCallResolverExtension); 107 callResolver.setTypeResolver(typeResolver); 108 109 argumentTypeResolver.setExpressionTypingServices(expressionTypingServices); 110 argumentTypeResolver.setTypeResolver(typeResolver); 111 112 candidateResolver.setArgumentTypeResolver(argumentTypeResolver); 113 114 } 115 116 @PreDestroy 117 public void destroy() { 118 } 119 120 public DescriptorResolver getDescriptorResolver() { 121 return this.descriptorResolver; 122 } 123 124 public ExpressionTypingServices getExpressionTypingServices() { 125 return this.expressionTypingServices; 126 } 127 128 public TypeResolver getTypeResolver() { 129 return this.typeResolver; 130 } 131 132 public ScopeProvider getScopeProvider() { 133 return this.scopeProvider; 134 } 135 136 public AnnotationResolver getAnnotationResolver() { 137 return this.annotationResolver; 138 } 139 140 public QualifiedExpressionResolver getQualifiedExpressionResolver() { 141 return this.qualifiedExpressionResolver; 142 } 143 144 public JetImportsFactory getJetImportsFactory() { 145 return this.jetImportsFactory; 146 } 147 148 }