< prev index next >

src/java.compiler/share/classes/javax/lang/model/element/ElementVisitor.java

Print this page




 149      */
 150     R visitUnknown(Element e, P p);
 151 
 152     /**
 153      * Visits a module element.
 154      *
 155      * @implSpec The default implementation visits a {@code
 156      * ModuleElement} by calling {@code visitUnknown(e, p)}.
 157      *
 158      * @param e  the element to visit
 159      * @param p  a visitor-specified parameter
 160      * @return a visitor-specified result
 161      * @since 9
 162      * @spec JPMS
 163      */
 164     default R visitModule(ModuleElement e, P p) {
 165         return visitUnknown(e, p);
 166     }
 167 
 168     /**








 169      * Visits a record component element.
 170      *
 171      * @implSpec The default implementation visits a {@code
 172      * RecordComponentElement} by calling {@code visitUnknown(e, p)}.
 173      *
 174      * @param e  the element to visit
 175      * @param p  a visitor-specified parameter
 176      * @return a visitor-specified result
 177      * @since 14
 178      * @deprecated This method is part of a preview feature and may be removed
 179      * if the preview feature is removed.
 180      */
 181     @Deprecated(forRemoval=true, since="14")
 182     @SuppressWarnings("removal")

 183     default R visitRecordComponent(RecordComponentElement e, P p) {
 184         return visitUnknown(e, p);
 185     }
 186 }


 149      */
 150     R visitUnknown(Element e, P p);
 151 
 152     /**
 153      * Visits a module element.
 154      *
 155      * @implSpec The default implementation visits a {@code
 156      * ModuleElement} by calling {@code visitUnknown(e, p)}.
 157      *
 158      * @param e  the element to visit
 159      * @param p  a visitor-specified parameter
 160      * @return a visitor-specified result
 161      * @since 9
 162      * @spec JPMS
 163      */
 164     default R visitModule(ModuleElement e, P p) {
 165         return visitUnknown(e, p);
 166     }
 167 
 168     /**
 169      * {@preview Associated with records, a preview feature of the Java language.
 170      *
 171      *           This method is associated with <i>records</i>, a preview
 172      *           feature of the Java language. Programs can only use this
 173      *           method when preview features are enabled. Preview features
 174      *           may be removed in a future release, or upgraded to permanent
 175      *           features of the Java language.}
 176      *
 177      * Visits a record component element.
 178      *
 179      * @implSpec The default implementation visits a {@code
 180      * RecordComponentElement} by calling {@code visitUnknown(e, p)}.
 181      *
 182      * @param e  the element to visit
 183      * @param p  a visitor-specified parameter
 184      * @return a visitor-specified result
 185      * @since 14


 186      */
 187     @jdk.internal.PreviewFeature(feature=jdk.internal.PreviewFeature.Feature.RECORDS,
 188                                  essentialAPI=false)
 189     @SuppressWarnings("preview")
 190     default R visitRecordComponent(RecordComponentElement e, P p) {
 191         return visitUnknown(e, p);
 192     }
 193 }
< prev index next >