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.codegen.state.JetTypeMapper;
020 import org.jetbrains.jet.codegen.state.GenerationState;
021 import org.jetbrains.jet.codegen.ClassBuilderFactory;
022 import com.intellij.openapi.project.Project;
023 import org.jetbrains.jet.lang.resolve.BindingTrace;
024 import org.jetbrains.jet.lang.resolve.BindingContext;
025 import org.jetbrains.jet.codegen.ClassBuilderMode;
026 import org.jetbrains.jet.codegen.intrinsics.IntrinsicMethods;
027 import org.jetbrains.jet.codegen.ClassFileFactory;
028 import org.jetbrains.annotations.NotNull;
029 import javax.annotation.PreDestroy;
030
031 /* This file is generated by org.jetbrains.jet.generators.injectors.GenerateInjectors. DO NOT EDIT! */
032 public class InjectorForJvmCodegen {
033
034 private final JetTypeMapper jetTypeMapper;
035 private final GenerationState generationState;
036 private final ClassBuilderFactory classBuilderFactory;
037 private final Project project;
038 private final BindingTrace bindingTrace;
039 private final BindingContext bindingContext;
040 private final ClassBuilderMode classBuilderMode;
041 private final IntrinsicMethods intrinsics;
042 private final ClassFileFactory classFileFactory;
043
044 public InjectorForJvmCodegen(
045 @NotNull JetTypeMapper jetTypeMapper,
046 @NotNull GenerationState generationState,
047 @NotNull ClassBuilderFactory classBuilderFactory,
048 @NotNull Project project
049 ) {
050 this.jetTypeMapper = jetTypeMapper;
051 this.generationState = generationState;
052 this.classBuilderFactory = classBuilderFactory;
053 this.project = project;
054 this.bindingTrace = jetTypeMapper.getBindingTrace();
055 this.bindingContext = bindingTrace.getBindingContext();
056 this.classBuilderMode = classBuilderFactory.getClassBuilderMode();
057 this.intrinsics = new IntrinsicMethods();
058 this.classFileFactory = new ClassFileFactory(getGenerationState());
059
060 this.classFileFactory.setBuilderFactory(classBuilderFactory);
061
062 intrinsics.init();
063
064 }
065
066 @PreDestroy
067 public void destroy() {
068 }
069
070 public JetTypeMapper getJetTypeMapper() {
071 return this.jetTypeMapper;
072 }
073
074 public GenerationState getGenerationState() {
075 return this.generationState;
076 }
077
078 public Project getProject() {
079 return this.project;
080 }
081
082 public IntrinsicMethods getIntrinsics() {
083 return this.intrinsics;
084 }
085
086 public ClassFileFactory getClassFileFactory() {
087 return this.classFileFactory;
088 }
089
090 }