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

Print this page




  79      * @return a visitor-specified result
  80      */
  81     public final R visit(TypeMirror t, P p) {
  82         return t.accept(this, p);
  83     }
  84 
  85     /**
  86      * Visits any type mirror as if by passing itself to that type
  87      * mirror's {@link TypeMirror#accept accept} method and passing
  88      * {@code null} for the additional parameter.  The invocation
  89      * {@code v.visit(t)} is equivalent to {@code t.accept(v, null)}.
  90      *
  91      * @param t  the type to visit
  92      * @return a visitor-specified result
  93      */
  94     public final R visit(TypeMirror t) {
  95         return t.accept(this, null);
  96     }
  97 
  98     /**
  99      * Visits a {@code DisjunctiveType} element by calling {@code
 100      * visitUnknown}.
 101 
 102      * @param t  {@inheritDoc}
 103      * @param p  {@inheritDoc}
 104      * @return the result of {@code visitUnknown}
 105      *
 106      * @since 1.7
 107      */
 108     public R visitDisjunctive(DisjunctiveType t, P p) {
 109         return visitUnknown(t, p);
 110     }
 111 
 112     /**
 113      * {@inheritDoc}
 114      *
 115      * <p> The default implementation of this method in {@code
 116      * AbstractTypeVisitor6} will always throw {@code
 117      * UnknownTypeException}.  This behavior is not required of a
 118      * subclass.
 119      *
 120      * @param t  the type to visit
 121      * @return a visitor-specified result
 122      * @throws UnknownTypeException
 123      *  a visitor implementation may optionally throw this exception
 124      */
 125     public R visitUnknown(TypeMirror t, P p) {
 126         throw new UnknownTypeException(t, p);
 127     }
 128 }


  79      * @return a visitor-specified result
  80      */
  81     public final R visit(TypeMirror t, P p) {
  82         return t.accept(this, p);
  83     }
  84 
  85     /**
  86      * Visits any type mirror as if by passing itself to that type
  87      * mirror's {@link TypeMirror#accept accept} method and passing
  88      * {@code null} for the additional parameter.  The invocation
  89      * {@code v.visit(t)} is equivalent to {@code t.accept(v, null)}.
  90      *
  91      * @param t  the type to visit
  92      * @return a visitor-specified result
  93      */
  94     public final R visit(TypeMirror t) {
  95         return t.accept(this, null);
  96     }
  97 
  98     /**
  99      * Visits a {@code UnionType} element by calling {@code
 100      * visitUnknown}.
 101 
 102      * @param t  {@inheritDoc}
 103      * @param p  {@inheritDoc}
 104      * @return the result of {@code visitUnknown}
 105      *
 106      * @since 1.7
 107      */
 108     public R visitUnion(UnionType t, P p) {
 109         return visitUnknown(t, p);
 110     }
 111 
 112     /**
 113      * {@inheritDoc}
 114      *
 115      * <p> The default implementation of this method in {@code
 116      * AbstractTypeVisitor6} will always throw {@code
 117      * UnknownTypeException}.  This behavior is not required of a
 118      * subclass.
 119      *
 120      * @param t  the type to visit
 121      * @return a visitor-specified result
 122      * @throws UnknownTypeException
 123      *  a visitor implementation may optionally throw this exception
 124      */
 125     public R visitUnknown(TypeMirror t, P p) {
 126         throw new UnknownTypeException(t, p);
 127     }
 128 }