< prev index next >

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

Print this page


   1 /*
   2  * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  60  * class will also be introduced to correspond to the new language
  61  * level; this visitor will have different default behavior for the
  62  * visit method in question.  When the new visitor is introduced, all
  63  * or portions of this visitor may be deprecated.
  64  *
  65  * @param <R> the return type of this visitor's methods.  Use {@code Void}
  66  *             for visitors that do not need to return results.
  67  * @param <P> the type of the additional parameter to this visitor's methods.  Use {@code Void}
  68  *              for visitors that do not need an additional parameter.
  69  *
  70  * @see SimpleElementVisitor6
  71  * @see SimpleElementVisitor8
  72  * @see SimpleElementVisitor9
  73  * @since 1.7
  74  */
  75 @SupportedSourceVersion(RELEASE_7)
  76 public class SimpleElementVisitor7<R, P> extends SimpleElementVisitor6<R, P> {
  77     /**
  78      * Constructor for concrete subclasses; uses {@code null} for the
  79      * default value.



  80      */
  81     @SuppressWarnings("deprecation") // Superclass constructor deprecated
  82     protected SimpleElementVisitor7(){
  83         super(null);
  84     }
  85 
  86     /**
  87      * Constructor for concrete subclasses; uses the argument for the
  88      * default value.
  89      *
  90      * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}



  91      */
  92     @SuppressWarnings("deprecation") // Superclass constructor deprecated
  93     protected SimpleElementVisitor7(R defaultValue){
  94         super(defaultValue);
  95     }
  96 
  97     /**
  98      * {@inheritDoc}
  99      *
 100      * @implSpec This implementation calls {@code defaultAction}.
 101      *
 102      * @param e {@inheritDoc}
 103      * @param p {@inheritDoc}
 104      * @return  {@inheritDoc}
 105      */
 106     @Override
 107     public R visitVariable(VariableElement e, P p) {
 108         return defaultAction(e, p);
 109     }
 110 }
   1 /*
   2  * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  60  * class will also be introduced to correspond to the new language
  61  * level; this visitor will have different default behavior for the
  62  * visit method in question.  When the new visitor is introduced, all
  63  * or portions of this visitor may be deprecated.
  64  *
  65  * @param <R> the return type of this visitor's methods.  Use {@code Void}
  66  *             for visitors that do not need to return results.
  67  * @param <P> the type of the additional parameter to this visitor's methods.  Use {@code Void}
  68  *              for visitors that do not need an additional parameter.
  69  *
  70  * @see SimpleElementVisitor6
  71  * @see SimpleElementVisitor8
  72  * @see SimpleElementVisitor9
  73  * @since 1.7
  74  */
  75 @SupportedSourceVersion(RELEASE_7)
  76 public class SimpleElementVisitor7<R, P> extends SimpleElementVisitor6<R, P> {
  77     /**
  78      * Constructor for concrete subclasses; uses {@code null} for the
  79      * default value.
  80      *
  81      * @deprecated Release 7 is obsolete; update to a visitor for a newer
  82      * release level.
  83      */
  84     @Deprecated
  85     protected SimpleElementVisitor7(){
  86         super(null); // Superclass constructor deprecated too
  87     }
  88 
  89     /**
  90      * Constructor for concrete subclasses; uses the argument for the
  91      * default value.
  92      *
  93      * @param defaultValue the value to assign to {@link #DEFAULT_VALUE}
  94      *
  95      * @deprecated Release 7 is obsolete; update to a visitor for a newer
  96      * release level.
  97      */
  98     @Deprecated
  99     protected SimpleElementVisitor7(R defaultValue){
 100         super(defaultValue); // Superclass constructor deprecated too
 101     }
 102 
 103     /**
 104      * {@inheritDoc}
 105      *
 106      * @implSpec This implementation calls {@code defaultAction}.
 107      *
 108      * @param e {@inheritDoc}
 109      * @param p {@inheritDoc}
 110      * @return  {@inheritDoc}
 111      */
 112     @Override
 113     public R visitVariable(VariableElement e, P p) {
 114         return defaultAction(e, p);
 115     }
 116 }
< prev index next >