8287597: List all preview features on the javadoc PREVIEW page

Reviewed-by: jjg
This commit is contained in:
Hannes Wallnöfer 2022-09-30 11:11:28 +00:00
parent b4e1e416da
commit 64da8620e1
24 changed files with 403 additions and 174 deletions

View file

@ -59,15 +59,38 @@ public @interface PreviewFeature {
public boolean reflective() default false;
/**
* Enum of preview features in the current release.
* Values should be annotated with the feature's {@code JEP}.
*/
public enum Feature {
SWITCH_PATTERN_MATCHING,
@JEP(number=427, title="Pattern Matching for switch", status="Third Preview")
SWITCH_PATTERN_MATCHING(),
@JEP(number=405, title="Record Patterns")
RECORD_PATTERNS,
@JEP(number=425, title="Virtual Threads")
VIRTUAL_THREADS,
@JEP(number=424, title="Foreign Function & Memory API")
FOREIGN,
/**
* A key for testing.
*/
@JEP(number=0, title="Test Feature")
TEST,
;
}
/**
* Annotation identifying the JEP associated with a preview feature.
*/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.CLASS)
@interface JEP {
/** JEP number */
int number() default 0;
/** JEP title in plain text */
String title();
/** JEP status such as "Preview", "Second Preview", etc */
String status() default "Preview";
}
}