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 org.jetbrains.jet.lang.resolve.BodyResolver;
020    import org.jetbrains.jet.lang.resolve.calls.CallResolverExtensionProvider;
021    import org.jetbrains.jet.lang.PlatformToKotlinClassMap;
022    import org.jetbrains.jet.lang.resolve.FunctionAnalyzerExtension;
023    import com.intellij.openapi.project.Project;
024    import org.jetbrains.jet.lang.resolve.TopDownAnalysisParameters;
025    import org.jetbrains.jet.lang.resolve.BindingTrace;
026    import org.jetbrains.jet.lang.resolve.BodiesResolveContext;
027    import org.jetbrains.jet.lang.descriptors.ModuleDescriptor;
028    import org.jetbrains.jet.lang.resolve.AnnotationResolver;
029    import org.jetbrains.jet.lang.resolve.calls.CallResolver;
030    import org.jetbrains.jet.lang.resolve.calls.ArgumentTypeResolver;
031    import org.jetbrains.jet.lang.types.expressions.ExpressionTypingServices;
032    import org.jetbrains.jet.lang.resolve.calls.CallExpressionResolver;
033    import org.jetbrains.jet.lang.resolve.DescriptorResolver;
034    import org.jetbrains.jet.lang.resolve.DelegatedPropertyResolver;
035    import org.jetbrains.jet.lang.resolve.TypeResolver;
036    import org.jetbrains.jet.lang.resolve.QualifiedExpressionResolver;
037    import org.jetbrains.jet.lang.resolve.calls.CandidateResolver;
038    import org.jetbrains.jet.lang.resolve.ControlFlowAnalyzer;
039    import org.jetbrains.jet.lang.resolve.DeclarationsChecker;
040    import org.jetbrains.jet.lang.resolve.ScriptBodyResolver;
041    import org.jetbrains.jet.lang.resolve.TopDownAnalysisContext;
042    import org.jetbrains.annotations.NotNull;
043    import javax.annotation.PreDestroy;
044    
045    /* This file is generated by org.jetbrains.jet.generators.injectors.GenerateInjectors. DO NOT EDIT! */
046    public class InjectorForBodyResolve {
047        
048        private final BodyResolver bodyResolver;
049        private final CallResolverExtensionProvider callResolverExtensionProvider;
050        private final PlatformToKotlinClassMap platformToKotlinClassMap;
051        private final FunctionAnalyzerExtension functionAnalyzerExtension;
052        private final Project project;
053        private final TopDownAnalysisParameters topDownAnalysisParameters;
054        private final BindingTrace bindingTrace;
055        private final BodiesResolveContext bodiesResolveContext;
056        private final ModuleDescriptor moduleDescriptor;
057        private final AnnotationResolver annotationResolver;
058        private final CallResolver callResolver;
059        private final ArgumentTypeResolver argumentTypeResolver;
060        private final ExpressionTypingServices expressionTypingServices;
061        private final CallExpressionResolver callExpressionResolver;
062        private final DescriptorResolver descriptorResolver;
063        private final DelegatedPropertyResolver delegatedPropertyResolver;
064        private final TypeResolver typeResolver;
065        private final QualifiedExpressionResolver qualifiedExpressionResolver;
066        private final CandidateResolver candidateResolver;
067        private final ControlFlowAnalyzer controlFlowAnalyzer;
068        private final DeclarationsChecker declarationsChecker;
069        private final ScriptBodyResolver scriptBodyResolver;
070        private final TopDownAnalysisContext topDownAnalysisContext;
071        
072        public InjectorForBodyResolve(
073            @NotNull Project project,
074            @NotNull TopDownAnalysisParameters topDownAnalysisParameters,
075            @NotNull BindingTrace bindingTrace,
076            @NotNull BodiesResolveContext bodiesResolveContext,
077            @NotNull ModuleDescriptor moduleDescriptor
078        ) {
079            this.bodyResolver = new BodyResolver();
080            this.callResolverExtensionProvider = new CallResolverExtensionProvider();
081            this.platformToKotlinClassMap = moduleDescriptor.getPlatformToKotlinClassMap();
082            this.functionAnalyzerExtension = new FunctionAnalyzerExtension();
083            this.project = project;
084            this.topDownAnalysisParameters = topDownAnalysisParameters;
085            this.bindingTrace = bindingTrace;
086            this.bodiesResolveContext = bodiesResolveContext;
087            this.moduleDescriptor = moduleDescriptor;
088            this.annotationResolver = new AnnotationResolver();
089            this.callResolver = new CallResolver();
090            this.argumentTypeResolver = new ArgumentTypeResolver();
091            this.expressionTypingServices = new ExpressionTypingServices();
092            this.callExpressionResolver = new CallExpressionResolver();
093            this.descriptorResolver = new DescriptorResolver();
094            this.delegatedPropertyResolver = new DelegatedPropertyResolver();
095            this.typeResolver = new TypeResolver();
096            this.qualifiedExpressionResolver = new QualifiedExpressionResolver();
097            this.candidateResolver = new CandidateResolver();
098            this.controlFlowAnalyzer = new ControlFlowAnalyzer();
099            this.declarationsChecker = new DeclarationsChecker();
100            this.scriptBodyResolver = new ScriptBodyResolver();
101            this.topDownAnalysisContext = new TopDownAnalysisContext();
102    
103            this.bodyResolver.setAnnotationResolver(annotationResolver);
104            this.bodyResolver.setCallResolver(callResolver);
105            this.bodyResolver.setContext(bodiesResolveContext);
106            this.bodyResolver.setControlFlowAnalyzer(controlFlowAnalyzer);
107            this.bodyResolver.setDeclarationsChecker(declarationsChecker);
108            this.bodyResolver.setDelegatedPropertyResolver(delegatedPropertyResolver);
109            this.bodyResolver.setExpressionTypingServices(expressionTypingServices);
110            this.bodyResolver.setFunctionAnalyzerExtension(functionAnalyzerExtension);
111            this.bodyResolver.setScriptBodyResolverResolver(scriptBodyResolver);
112            this.bodyResolver.setTopDownAnalysisParameters(topDownAnalysisParameters);
113            this.bodyResolver.setTrace(bindingTrace);
114    
115            functionAnalyzerExtension.setTrace(bindingTrace);
116    
117            annotationResolver.setCallResolver(callResolver);
118            annotationResolver.setExpressionTypingServices(expressionTypingServices);
119    
120            callResolver.setArgumentTypeResolver(argumentTypeResolver);
121            callResolver.setCandidateResolver(candidateResolver);
122            callResolver.setExpressionTypingServices(expressionTypingServices);
123            callResolver.setTypeResolver(typeResolver);
124    
125            argumentTypeResolver.setExpressionTypingServices(expressionTypingServices);
126            argumentTypeResolver.setTypeResolver(typeResolver);
127    
128            expressionTypingServices.setAnnotationResolver(annotationResolver);
129            expressionTypingServices.setCallExpressionResolver(callExpressionResolver);
130            expressionTypingServices.setCallResolver(callResolver);
131            expressionTypingServices.setDescriptorResolver(descriptorResolver);
132            expressionTypingServices.setExtensionProvider(callResolverExtensionProvider);
133            expressionTypingServices.setPlatformToKotlinClassMap(platformToKotlinClassMap);
134            expressionTypingServices.setProject(project);
135            expressionTypingServices.setTypeResolver(typeResolver);
136    
137            callExpressionResolver.setExpressionTypingServices(expressionTypingServices);
138    
139            descriptorResolver.setAnnotationResolver(annotationResolver);
140            descriptorResolver.setDelegatedPropertyResolver(delegatedPropertyResolver);
141            descriptorResolver.setExpressionTypingServices(expressionTypingServices);
142            descriptorResolver.setTypeResolver(typeResolver);
143    
144            delegatedPropertyResolver.setExpressionTypingServices(expressionTypingServices);
145    
146            typeResolver.setAnnotationResolver(annotationResolver);
147            typeResolver.setModuleDescriptor(moduleDescriptor);
148            typeResolver.setQualifiedExpressionResolver(qualifiedExpressionResolver);
149    
150            candidateResolver.setArgumentTypeResolver(argumentTypeResolver);
151    
152            controlFlowAnalyzer.setTopDownAnalysisParameters(topDownAnalysisParameters);
153            controlFlowAnalyzer.setTrace(bindingTrace);
154    
155            declarationsChecker.setTrace(bindingTrace);
156    
157            scriptBodyResolver.setContext(topDownAnalysisContext);
158            scriptBodyResolver.setExpressionTypingServices(expressionTypingServices);
159            scriptBodyResolver.setTrace(bindingTrace);
160    
161            topDownAnalysisContext.setTopDownAnalysisParameters(topDownAnalysisParameters);
162    
163        }
164        
165        @PreDestroy
166        public void destroy() {
167        }
168        
169        public BodyResolver getBodyResolver() {
170            return this.bodyResolver;
171        }
172        
173        public Project getProject() {
174            return this.project;
175        }
176        
177        public TopDownAnalysisParameters getTopDownAnalysisParameters() {
178            return this.topDownAnalysisParameters;
179        }
180        
181        public BindingTrace getBindingTrace() {
182            return this.bindingTrace;
183        }
184        
185        public BodiesResolveContext getBodiesResolveContext() {
186            return this.bodiesResolveContext;
187        }
188        
189    }