< prev index next >

src/java.compiler/share/classes/javax/lang/model/util/ElementKindVisitor7.java

Print this page




  68  * <p>Note that adding a default implementation of a new visit method
  69  * in a visitor class will occur instead of adding a <em>default
  70  * method</em> directly in the visitor interface since a Java SE 8
  71  * language feature cannot be used to this version of the API since
  72  * this version is required to be runnable on Java SE 7
  73  * implementations.  Future versions of the API that are only required
  74  * to run on Java SE 8 and later may take advantage of default methods
  75  * in this situation.
  76  *
  77  * @param <R> the return type of this visitor's methods.  Use {@link
  78  *            Void} for visitors that do not need to return results.
  79  * @param <P> the type of the additional parameter to this visitor's
  80  *            methods.  Use {@code Void} for visitors that do not need an
  81  *            additional parameter.
  82  *
  83  * @see ElementKindVisitor6
  84  * @see ElementKindVisitor8
  85  * @see ElementKindVisitor9
  86  * @since 1.7
  87  */
  88 @SuppressWarnings("deprecation") // Superclass deprecated
  89 @SupportedSourceVersion(RELEASE_7)
  90 public class ElementKindVisitor7<R, P> extends ElementKindVisitor6<R, P> {
  91     /**
  92      * Constructor for concrete subclasses; uses {@code null} for the
  93      * default value.
  94      */

  95     protected ElementKindVisitor7() {
  96         super(null);
  97     }
  98 
  99     /**
 100      * Constructor for concrete subclasses; uses the argument for the
 101      * default value.
 102      *
 103      * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
 104      */

 105     protected ElementKindVisitor7(R defaultValue) {
 106         super(defaultValue);
 107     }
 108 
 109     /**
 110      * Visits a {@code RESOURCE_VARIABLE} variable element by calling
 111      * {@code defaultAction}.
 112      *
 113      * @param e {@inheritDoc}
 114      * @param p {@inheritDoc}
 115      * @return  the result of {@code defaultAction}
 116      */
 117     @Override
 118     public R visitVariableAsResourceVariable(VariableElement e, P p) {
 119         return defaultAction(e, p);
 120     }
 121 }


  68  * <p>Note that adding a default implementation of a new visit method
  69  * in a visitor class will occur instead of adding a <em>default
  70  * method</em> directly in the visitor interface since a Java SE 8
  71  * language feature cannot be used to this version of the API since
  72  * this version is required to be runnable on Java SE 7
  73  * implementations.  Future versions of the API that are only required
  74  * to run on Java SE 8 and later may take advantage of default methods
  75  * in this situation.
  76  *
  77  * @param <R> the return type of this visitor's methods.  Use {@link
  78  *            Void} for visitors that do not need to return results.
  79  * @param <P> the type of the additional parameter to this visitor's
  80  *            methods.  Use {@code Void} for visitors that do not need an
  81  *            additional parameter.
  82  *
  83  * @see ElementKindVisitor6
  84  * @see ElementKindVisitor8
  85  * @see ElementKindVisitor9
  86  * @since 1.7
  87  */

  88 @SupportedSourceVersion(RELEASE_7)
  89 public class ElementKindVisitor7<R, P> extends ElementKindVisitor6<R, P> {
  90     /**
  91      * Constructor for concrete subclasses; uses {@code null} for the
  92      * default value.
  93      */
  94     @SuppressWarnings("deprecation") // Superclass constructor deprecated
  95     protected ElementKindVisitor7() {
  96         super(null);
  97     }
  98 
  99     /**
 100      * Constructor for concrete subclasses; uses the argument for the
 101      * default value.
 102      *
 103      * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
 104      */
 105     @SuppressWarnings("deprecation") // Superclass constructor deprecated
 106     protected ElementKindVisitor7(R defaultValue) {
 107         super(defaultValue);
 108     }
 109 
 110     /**
 111      * Visits a {@code RESOURCE_VARIABLE} variable element by calling
 112      * {@code defaultAction}.
 113      *
 114      * @param e {@inheritDoc}
 115      * @param p {@inheritDoc}
 116      * @return  the result of {@code defaultAction}
 117      */
 118     @Override
 119     public R visitVariableAsResourceVariable(VariableElement e, P p) {
 120         return defaultAction(e, p);
 121     }
 122 }
< prev index next >