• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.tools.metalava.model
18 
19 const val JAVA_ENUM_VALUES = "values"
20 const val JAVA_ENUM_VALUE_OF = "valueOf"
21 
22 const val JAVA_LANG_PACKAGE = "java.lang"
23 const val JAVA_LANG_PREFIX = "java.lang."
24 
25 const val JAVA_LANG_ANNOTATION = "java.lang.annotation.Annotation"
26 const val JAVA_LANG_DEPRECATED = "java.lang.Deprecated"
27 const val JAVA_LANG_ENUM = "java.lang.Enum"
28 const val JAVA_LANG_OBJECT = "java.lang.Object"
29 const val JAVA_LANG_STRING = "java.lang.String"
30 const val JAVA_LANG_THROWABLE = "java.lang.Throwable"
31 
32 const val JAVA_LANG_ANNOTATION_TARGET = "java.lang.annotation.Target"
33 const val JAVA_LANG_TYPE_USE_TARGET = "java.lang.annotation.ElementType.TYPE_USE"
34 const val JAVA_LANG_METHOD_TARGET = "java.lang.annotation.ElementType.METHOD"
35 const val JAVA_LANG_FIELD_TARGET = "java.lang.annotation.ElementType.FIELD"
36 const val JAVA_LANG_PARAMETER_TARGET = "java.lang.annotation.ElementType.PARAMETER"
37 
38 const val JAVA_RETENTION = "java.lang.annotation.Retention"
39 const val KT_RETENTION = "kotlin.annotation.Retention"
40 
41 const val JVM_STATIC = "kotlin.jvm.JvmStatic"
42 
43 /** True if the annotation name represents @Retention (either the Java or Kotlin version) */
isRetentionnull44 fun isRetention(qualifiedName: String?): Boolean =
45     JAVA_RETENTION == qualifiedName || KT_RETENTION == qualifiedName
46 
47 const val JAVA_PACKAGE_INFO = "package-info.java"
48