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.lang.resolve.java; 018 019 import org.jetbrains.annotations.NotNull; 020 import org.jetbrains.jet.lang.resolve.name.FqName; 021 import org.jetbrains.jet.lang.resolve.name.Name; 022 023 public final class JvmAnnotationNames { 024 public static final FqName KOTLIN_CLASS = new FqName("kotlin.jvm.internal.KotlinClass"); 025 public static final FqName KOTLIN_PACKAGE = new FqName("kotlin.jvm.internal.KotlinPackage"); 026 public static final FqName KOTLIN_SYNTHETIC_CLASS = new FqName("kotlin.jvm.internal.KotlinSyntheticClass"); 027 028 public static final FqName KOTLIN_SIGNATURE = new FqName("kotlin.jvm.KotlinSignature"); 029 public static final FqName OLD_KOTLIN_SIGNATURE = new FqName("jet.runtime.typeinfo.KotlinSignature"); 030 031 public static final String ABI_VERSION_FIELD_NAME = "abiVersion"; 032 public static final String DATA_FIELD_NAME = "data"; 033 public static final Name DEFAULT_ANNOTATION_MEMBER_NAME = Name.identifier("value"); 034 035 public static final FqName JETBRAINS_NOT_NULL_ANNOTATION = new FqName("org.jetbrains.annotations.NotNull"); 036 public static final FqName JETBRAINS_NULLABLE_ANNOTATION = new FqName("org.jetbrains.annotations.Nullable"); 037 public static final FqName JETBRAINS_MUTABLE_ANNOTATION = new FqName("org.jetbrains.annotations.Mutable"); 038 public static final FqName JETBRAINS_READONLY_ANNOTATION = new FqName("org.jetbrains.annotations.ReadOnly"); 039 040 @Deprecated 041 public static final FqName OLD_JET_CLASS_ANNOTATION = new FqName("jet.runtime.typeinfo.JetClass"); 042 @Deprecated 043 public static final FqName OLD_JET_PACKAGE_CLASS_ANNOTATION = new FqName("jet.runtime.typeinfo.JetPackageClass"); 044 @Deprecated 045 public static final FqName OLD_JET_VALUE_PARAMETER_ANNOTATION = new FqName("jet.runtime.typeinfo.JetValueParameter"); 046 @Deprecated 047 public static final FqName OLD_KOTLIN_CLASS = new FqName("jet.KotlinClass"); 048 @Deprecated 049 public static final FqName OLD_KOTLIN_PACKAGE = new FqName("jet.KotlinPackage"); 050 @Deprecated 051 public static final FqName OLD_KOTLIN_PACKAGE_FRAGMENT = new FqName("jet.KotlinPackageFragment"); 052 @Deprecated 053 public static final FqName OLD_KOTLIN_TRAIT_IMPL = new FqName("jet.KotlinTraitImpl"); 054 055 @SuppressWarnings("deprecation") 056 public static boolean isSpecialAnnotation(@NotNull FqName fqName) { 057 return fqName.asString().startsWith("jet.runtime.typeinfo.") 058 || fqName.equals(KOTLIN_SIGNATURE) 059 || fqName.equals(JETBRAINS_NOT_NULL_ANNOTATION) 060 || fqName.equals(OLD_KOTLIN_CLASS) 061 || fqName.equals(OLD_KOTLIN_PACKAGE) 062 || fqName.equals(KOTLIN_CLASS) 063 || fqName.equals(KOTLIN_PACKAGE); 064 } 065 066 private JvmAnnotationNames() { 067 } 068 }