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