< prev index next >
src/java.compiler/share/classes/javax/lang/model/element/AnnotationValueVisitor.java
Print this page
@@ -66,12 +66,12 @@
* <em>default methods</em>. However, default methods are only
* available on Java SE 8 and higher releases and the {@code
* javax.lang.model.*} packages bundled in Java SE 8 were required to
* also be runnable on Java SE 7. Therefore, default methods
* were <em>not</em> used when extending {@code javax.lang.model.*}
- * to cover Java SE 8 language features. However, default methods may
- * be used in subsequent revisions of the {@code javax.lang.model.*}
+ * to cover Java SE 8 language features. However, default methods
+ * are used in subsequent revisions of the {@code javax.lang.model.*}
* packages that are only required to run on Java SE 8 and higher
* platform versions.
*
* @param <R> the return type of this visitor's methods
* @param <P> the type of the additional parameter to this visitor's methods.
@@ -88,15 +88,20 @@
* @return a visitor-specified result
*/
R visit(AnnotationValue av, P p);
/**
- * A convenience method equivalent to {@code v.visit(av, null)}.
+ * A convenience method equivalent to {@code visit(av, null)}.
+ *
+ * @implSpec The default implementation is {@code visit(av, null)}.
+ *
* @param av the value to visit
* @return a visitor-specified result
*/
- R visit(AnnotationValue av);
+ default R visit(AnnotationValue av) {
+ return visit(av, null);
+ }
/**
* Visits a {@code boolean} value in an annotation.
* @param b the value being visited
* @param p a visitor-specified parameter
< prev index next >