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