src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java

Print this page




  40  * classes which extend this class should not declare any instance
  41  * methods with names beginning with {@code "visit"}.
  42  *
  43  * <p>When such a new visit method is added, the default
  44  * implementation in this class will be to call the {@link
  45  * #visitUnknown visitUnknown} method.  A new abstract type visitor
  46  * class will also be introduced to correspond to the new language
  47  * level; this visitor will have different default behavior for the
  48  * visit method in question.  When the new visitor is introduced, all
  49  * or portions of this visitor may be deprecated.
  50  *
  51  * @param <R> the return type of this visitor's methods.  Use {@link
  52  *            Void} for visitors that do not need to return results.
  53  * @param <P> the type of the additional parameter to this visitor's
  54  *            methods.  Use {@code Void} for visitors that do not need an
  55  *            additional parameter.
  56  *
  57  * @author Joseph D. Darcy
  58  * @author Scott Seligman
  59  * @author Peter von der Ah&eacute;


  60  * @since 1.6
  61  */
  62 public abstract class AbstractTypeVisitor6<R, P> implements TypeVisitor<R, P> {
  63     /**
  64      * Constructor for concrete subclasses to call.
  65      */
  66     protected AbstractTypeVisitor6() {}
  67 
  68     /**
  69      * Visits any type mirror as if by passing itself to that type
  70      * mirror's {@link TypeMirror#accept accept} method.  The
  71      * invocation {@code v.visit(t, p)} is equivalent to {@code
  72      * t.accept(v, p)}.
  73      *
  74      * @param t  the type to visit
  75      * @param p  a visitor-specified parameter
  76      * @return a visitor-specified result
  77      */
  78     public final R visit(TypeMirror t, P p) {
  79         return t.accept(this, p);




  40  * classes which extend this class should not declare any instance
  41  * methods with names beginning with {@code "visit"}.
  42  *
  43  * <p>When such a new visit method is added, the default
  44  * implementation in this class will be to call the {@link
  45  * #visitUnknown visitUnknown} method.  A new abstract type visitor
  46  * class will also be introduced to correspond to the new language
  47  * level; this visitor will have different default behavior for the
  48  * visit method in question.  When the new visitor is introduced, all
  49  * or portions of this visitor may be deprecated.
  50  *
  51  * @param <R> the return type of this visitor's methods.  Use {@link
  52  *            Void} for visitors that do not need to return results.
  53  * @param <P> the type of the additional parameter to this visitor's
  54  *            methods.  Use {@code Void} for visitors that do not need an
  55  *            additional parameter.
  56  *
  57  * @author Joseph D. Darcy
  58  * @author Scott Seligman
  59  * @author Peter von der Ah&eacute;
  60  *
  61  * @see AbstractTypeVisitor7
  62  * @since 1.6
  63  */
  64 public abstract class AbstractTypeVisitor6<R, P> implements TypeVisitor<R, P> {
  65     /**
  66      * Constructor for concrete subclasses to call.
  67      */
  68     protected AbstractTypeVisitor6() {}
  69 
  70     /**
  71      * Visits any type mirror as if by passing itself to that type
  72      * mirror's {@link TypeMirror#accept accept} method.  The
  73      * invocation {@code v.visit(t, p)} is equivalent to {@code
  74      * t.accept(v, p)}.
  75      *
  76      * @param t  the type to visit
  77      * @param p  a visitor-specified parameter
  78      * @return a visitor-specified result
  79      */
  80     public final R visit(TypeMirror t, P p) {
  81         return t.accept(this, p);