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