51 * 52 * <p> <b>WARNING:</b> It is possible that methods will be added to 53 * this interface to accommodate new, currently unknown, language 54 * structures added to future versions of the Java™ programming 55 * language. Therefore, visitor classes directly implementing this 56 * interface may be source incompatible with future versions of the 57 * platform. To avoid this source incompatibility, visitor 58 * implementations are encouraged to instead extend the appropriate 59 * abstract visitor class that implements this interface. However, an 60 * API should generally use this visitor interface as the type for 61 * parameters, return type, etc. rather than one of the abstract 62 * classes. 63 * 64 * <p>Note that methods to accommodate new language constructs could 65 * be added in a source <em>compatible</em> way if they were added as 66 * <em>default methods</em>. However, default methods are only 67 * available on Java SE 8 and higher releases and the {@code 68 * javax.lang.model.*} packages bundled in Java SE 8 were required to 69 * also be runnable on Java SE 7. Therefore, default methods 70 * were <em>not</em> used when extending {@code javax.lang.model.*} 71 * to cover Java SE 8 language features. However, default methods may 72 * be used in subsequent revisions of the {@code javax.lang.model.*} 73 * packages that are only required to run on Java SE 8 and higher 74 * platform versions. 75 * 76 * @param <R> the return type of this visitor's methods 77 * @param <P> the type of the additional parameter to this visitor's methods. 78 * @author Joseph D. Darcy 79 * @author Scott Seligman 80 * @author Peter von der Ahé 81 * @since 1.6 82 */ 83 public interface AnnotationValueVisitor<R, P> { 84 /** 85 * Visits an annotation value. 86 * @param av the value to visit 87 * @param p a visitor-specified parameter 88 * @return a visitor-specified result 89 */ 90 R visit(AnnotationValue av, P p); 91 92 /** | 51 * 52 * <p> <b>WARNING:</b> It is possible that methods will be added to 53 * this interface to accommodate new, currently unknown, language 54 * structures added to future versions of the Java™ programming 55 * language. Therefore, visitor classes directly implementing this 56 * interface may be source incompatible with future versions of the 57 * platform. To avoid this source incompatibility, visitor 58 * implementations are encouraged to instead extend the appropriate 59 * abstract visitor class that implements this interface. However, an 60 * API should generally use this visitor interface as the type for 61 * parameters, return type, etc. rather than one of the abstract 62 * classes. 63 * 64 * <p>Note that methods to accommodate new language constructs could 65 * be added in a source <em>compatible</em> way if they were added as 66 * <em>default methods</em>. However, default methods are only 67 * available on Java SE 8 and higher releases and the {@code 68 * javax.lang.model.*} packages bundled in Java SE 8 were required to 69 * also be runnable on Java SE 7. Therefore, default methods 70 * were <em>not</em> used when extending {@code javax.lang.model.*} 71 * to cover Java SE 8 language features. However, default methods 72 * are used in subsequent revisions of the {@code javax.lang.model.*} 73 * packages that are only required to run on Java SE 8 and higher 74 * platform versions. 75 * 76 * @param <R> the return type of this visitor's methods 77 * @param <P> the type of the additional parameter to this visitor's methods. 78 * @author Joseph D. Darcy 79 * @author Scott Seligman 80 * @author Peter von der Ahé 81 * @since 1.6 82 */ 83 public interface AnnotationValueVisitor<R, P> { 84 /** 85 * Visits an annotation value. 86 * @param av the value to visit 87 * @param p a visitor-specified parameter 88 * @return a visitor-specified result 89 */ 90 R visit(AnnotationValue av, P p); 91 92 /** |