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 org.jetbrains.jet.lang.types.expressions.ExpressionTypingServices;
020import org.jetbrains.jet.lang.resolve.calls.NeedSyntheticCallResolverExtension;
021import com.intellij.openapi.project.Project;
022import org.jetbrains.jet.lang.descriptors.ModuleDescriptor;
023import org.jetbrains.jet.lang.resolve.calls.CallExpressionResolver;
024import org.jetbrains.jet.lang.resolve.calls.CallResolver;
025import org.jetbrains.jet.lang.resolve.calls.ArgumentTypeResolver;
026import org.jetbrains.jet.lang.resolve.TypeResolver;
027import org.jetbrains.jet.lang.resolve.AnnotationResolver;
028import org.jetbrains.jet.lang.resolve.DescriptorResolver;
029import org.jetbrains.jet.lang.resolve.QualifiedExpressionResolver;
030import org.jetbrains.jet.lang.resolve.calls.CandidateResolver;
031import org.jetbrains.annotations.NotNull;
032import javax.annotation.PreDestroy;
033
034/* This file is generated by org.jetbrains.jet.generators.injectors.GenerateInjectors. DO NOT EDIT! */
035public class InjectorForMacros {
036    
037    private ExpressionTypingServices expressionTypingServices;
038    private NeedSyntheticCallResolverExtension needSyntheticCallResolverExtension;
039    private final Project project;
040    private final ModuleDescriptor moduleDescriptor;
041    private CallExpressionResolver callExpressionResolver;
042    private CallResolver callResolver;
043    private ArgumentTypeResolver argumentTypeResolver;
044    private TypeResolver typeResolver;
045    private AnnotationResolver annotationResolver;
046    private DescriptorResolver descriptorResolver;
047    private QualifiedExpressionResolver qualifiedExpressionResolver;
048    private CandidateResolver candidateResolver;
049    
050    public InjectorForMacros(
051        @NotNull Project project,
052        @NotNull ModuleDescriptor moduleDescriptor
053    ) {
054        this.expressionTypingServices = new ExpressionTypingServices();
055        this.needSyntheticCallResolverExtension = new NeedSyntheticCallResolverExtension();
056        this.project = project;
057        this.moduleDescriptor = moduleDescriptor;
058        this.callExpressionResolver = new CallExpressionResolver();
059        this.callResolver = new CallResolver();
060        this.argumentTypeResolver = new ArgumentTypeResolver();
061        this.typeResolver = new TypeResolver();
062        this.annotationResolver = new AnnotationResolver();
063        this.descriptorResolver = new DescriptorResolver();
064        this.qualifiedExpressionResolver = new QualifiedExpressionResolver();
065        this.candidateResolver = new CandidateResolver();
066
067        this.expressionTypingServices.setCallExpressionResolver(callExpressionResolver);
068        this.expressionTypingServices.setCallResolver(callResolver);
069        this.expressionTypingServices.setDescriptorResolver(descriptorResolver);
070        this.expressionTypingServices.setProject(project);
071        this.expressionTypingServices.setTypeResolver(typeResolver);
072
073        callExpressionResolver.setExpressionTypingServices(expressionTypingServices);
074
075        callResolver.setArgumentTypeResolver(argumentTypeResolver);
076        callResolver.setCandidateResolver(candidateResolver);
077        callResolver.setExpressionTypingServices(expressionTypingServices);
078        callResolver.setExtension(needSyntheticCallResolverExtension);
079        callResolver.setTypeResolver(typeResolver);
080
081        argumentTypeResolver.setExpressionTypingServices(expressionTypingServices);
082        argumentTypeResolver.setTypeResolver(typeResolver);
083
084        typeResolver.setAnnotationResolver(annotationResolver);
085        typeResolver.setDescriptorResolver(descriptorResolver);
086        typeResolver.setModuleDescriptor(moduleDescriptor);
087        typeResolver.setQualifiedExpressionResolver(qualifiedExpressionResolver);
088
089        annotationResolver.setCallResolver(callResolver);
090        annotationResolver.setExpressionTypingServices(expressionTypingServices);
091
092        descriptorResolver.setAnnotationResolver(annotationResolver);
093        descriptorResolver.setExpressionTypingServices(expressionTypingServices);
094        descriptorResolver.setTypeResolver(typeResolver);
095
096        candidateResolver.setArgumentTypeResolver(argumentTypeResolver);
097
098    }
099    
100    @PreDestroy
101    public void destroy() {
102    }
103    
104    public ExpressionTypingServices getExpressionTypingServices() {
105        return this.expressionTypingServices;
106    }
107    
108    public Project getProject() {
109        return this.project;
110    }
111    
112}