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.codegen;
018
019public class OwnerKind {
020    private final String name;
021
022    protected OwnerKind(String name) {
023        this.name = name;
024    }
025
026    public static final OwnerKind NAMESPACE = new OwnerKind("namespace");
027    public static final OwnerKind IMPLEMENTATION = new OwnerKind("implementation");
028    public static final OwnerKind TRAIT_IMPL = new OwnerKind("trait implementation");
029
030    public static class StaticDelegateKind extends OwnerKind {
031        private final String ownerClass;
032
033        public StaticDelegateKind(String ownerClass) {
034            super("staticDelegateKind");
035            this.ownerClass = ownerClass;
036        }
037
038        public String getOwnerClass() {
039            return ownerClass;
040        }
041    }
042
043    @Override
044    public String toString() {
045        return "OwnerKind(" + name + ")";
046    }
047}