platform API: introduce ApiStatus.Internal annotation (IDEA-211175)

Usages of elements annotated with it in external plugins will be highlighted as warnings.
This commit is contained in:
nik
2019-04-17 09:05:22 +03:00
parent d8ac61cb65
commit 3ab4ba71b7
2 changed files with 13 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ import static com.intellij.codeInspection.deprecation.DeprecationInspectionBase.
public class UnstableApiUsageInspection extends AnnotatedElementInspectionBase { public class UnstableApiUsageInspection extends AnnotatedElementInspectionBase {
public final List<String> unstableApiAnnotations = new ExternalizableStringSet( public final List<String> unstableApiAnnotations = new ExternalizableStringSet(
"org.jetbrains.annotations.ApiStatus.Experimental", "org.jetbrains.annotations.ApiStatus.Experimental",
"org.jetbrains.annotations.ApiStatus.Internal",
"com.google.common.annotations.Beta", "com.google.common.annotations.Beta",
"io.reactivex.annotations.Beta", "io.reactivex.annotations.Beta",
"io.reactivex.annotations.Experimental", "io.reactivex.annotations.Experimental",

View File

@@ -22,6 +22,18 @@ public class ApiStatus {
}) })
public @interface Experimental {} public @interface Experimental {}
/**
* Indicates that the annotated element (class, method, field, etc) must not be considered as a public API. It's made visible to allow its
* usage from other parts of the sources codebase where it is declared, but it must not be used outside of that codebase. Such elements
* may be renamed, changed or removed in future versions.
*/
@Documented
@Retention(RetentionPolicy.CLASS)
@Target({
ElementType.TYPE, ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.PACKAGE
})
public @interface Internal {}
/** /**
* Indicates that a public API of the annotated element (class, method or field) is subject to removal in a future version. It's a stronger * Indicates that a public API of the annotated element (class, method or field) is subject to removal in a future version. It's a stronger
* variant of {@link Deprecated} annotation. * variant of {@link Deprecated} annotation.