< prev index next >
src/java.compiler/share/classes/javax/lang/model/util/Elements.java
Print this page
@@ -630,21 +630,28 @@
* @since 1.8
*/
boolean isFunctionalInterface(TypeElement type);
/**
+ * {@preview Associated with records, a preview feature of the Java language.
+ *
+ * This method is associated with <i>records</i>, a preview
+ * feature of the Java language. Programs can only use this
+ * method when preview features are enabled. Preview features
+ * may be removed in a future release, or upgraded to permanent
+ * features of the Java language.}
+ *
* Returns the record component for the given accessor. Returns null if the
* given method is not a record component accessor.
*
* @param accessor the method for which the record component should be found.
* @return the record component, or null if the given method is not an record component accessor
* @since 14
- * @deprecated This method is part of a preview feature and may be removed
- * if the preview feature is removed.
*/
- @Deprecated(forRemoval=true, since="14")
- @SuppressWarnings("removal")
+ @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.RECORDS,
+ essentialAPI=false)
+ @SuppressWarnings("preview")
default RecordComponentElement recordComponentFor(ExecutableElement accessor) {
if (accessor.getEnclosingElement().getKind() == ElementKind.RECORD) {
for (RecordComponentElement rec : ElementFilter.recordComponentsIn(accessor.getEnclosingElement().getEnclosedElements())) {
if (Objects.equals(rec.getAccessor(), accessor)) {
return rec;
< prev index next >