47 ElementType.PACKAGE,
48 ElementType.MODULE,
49 ElementType.TYPE})
50 // CLASS retention will hopefully be sufficient for the purposes at hand
51 @Retention(RetentionPolicy.CLASS)
52 // *Not* @Documented
53 public @interface PreviewFeature {
54 /**
55 * Name of the preview feature the annotated API is associated
56 * with.
57 */
58 public Feature feature();
59
60 public boolean reflective() default false;
61
62 /**
63 * Enum of preview features in the current release.
64 * Values should be annotated with the feature's {@code JEP}.
65 */
66 public enum Feature {
67 @JEP(number=525, title="Structured Concurrency", status="Sixth Preview")
68 STRUCTURED_CONCURRENCY,
69 @JEP(number = 526, title = "Lazy Constants", status = "Second Preview")
70 LAZY_CONSTANTS,
71 @JEP(number=524, title="PEM Encodings of Cryptographic Objects",
72 status="Second Preview")
73 PEM_API,
74 LANGUAGE_MODEL,
75 /**
76 * A key for testing.
77 */
78 @JEP(number=2_147_483_647, title="Test Feature")
79 TEST,
80 ;
81 }
82
83 /**
84 * Annotation identifying the JEP associated with a preview feature.
85 */
86 @Target(ElementType.FIELD)
|
47 ElementType.PACKAGE,
48 ElementType.MODULE,
49 ElementType.TYPE})
50 // CLASS retention will hopefully be sufficient for the purposes at hand
51 @Retention(RetentionPolicy.CLASS)
52 // *Not* @Documented
53 public @interface PreviewFeature {
54 /**
55 * Name of the preview feature the annotated API is associated
56 * with.
57 */
58 public Feature feature();
59
60 public boolean reflective() default false;
61
62 /**
63 * Enum of preview features in the current release.
64 * Values should be annotated with the feature's {@code JEP}.
65 */
66 public enum Feature {
67 @JEP(number = 8350458, title = "Strict Field Initialization in the JVM", status = "Preview")
68 STRICT_FIELDS,
69 @JEP(number=401, title="Value Classes and Objects", status = "Preview")
70 VALUE_OBJECTS,
71 @JEP(number=525, title="Structured Concurrency", status="Sixth Preview")
72 STRUCTURED_CONCURRENCY,
73 @JEP(number = 526, title = "Lazy Constants", status = "Second Preview")
74 LAZY_CONSTANTS,
75 @JEP(number=524, title="PEM Encodings of Cryptographic Objects",
76 status="Second Preview")
77 PEM_API,
78 LANGUAGE_MODEL,
79 /**
80 * A key for testing.
81 */
82 @JEP(number=2_147_483_647, title="Test Feature")
83 TEST,
84 ;
85 }
86
87 /**
88 * Annotation identifying the JEP associated with a preview feature.
89 */
90 @Target(ElementType.FIELD)
|