• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 Square, Inc.
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  * https://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 package com.squareup.kotlinpoet
17 
18 /**
19  * Marks declarations in the KotlinPoet API that are **delicate** —
20  * they have limited use-case and shall be used with care in general code.
21  * Any use of a delicate declaration has to be carefully reviewed to make sure it is
22  * properly used and does not create problems like lossy Java -> Kotlin type parsing.
23  * Carefully read documentation and [message] of any declaration marked as `DelicateKotlinPoetApi`.
24  */
25 @MustBeDocumented
26 @Retention(value = AnnotationRetention.BINARY)
27 @RequiresOptIn(
28   level = RequiresOptIn.Level.WARNING,
29   message = "This is a delicate API and its use requires care." +
30     " Make sure you fully read and understand documentation of the declaration that is marked as a delicate API.",
31 )
32 public annotation class DelicateKotlinPoetApi(val message: String)
33