-
CSR
-
Resolution: Approved
-
P4
-
None
-
minimal
-
New default method added to an interface.
-
Java API
-
SE
Summary
Provide a method on ProcessingEnvironment
to allow the whether or not preview features are enabled to be determined.
Problem
When generating code, a sophisticated annotation processor could benefit from knowing whether or not preview language feature are available.
Solution
Provide a predicated on ProcessingEnvironment
to return whether or not preview features are enabled.
Specification
+ /**
+ * Returns {@code true} if <em>preview features</em> are enabled
+ * and {@code false} otherwise.
+ * @return whether or not preview features are enabled
+ *
+ * @implSpec The default implementation of this method returns
+ * {@code false}.
+ *
+ * @since 13
+ */
+ default boolean isPreviewEnabled() {
+ return false;
+ }
- csr of
-
JDK-8222378 Provide mechanism to query preview feature status for annotation processors
- Resolved