AbstractTypeVisitor8.java revision 3884:b6960e2da008
1228753Smm/* 2228753Smm * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. 3228753Smm * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4228753Smm * 5228753Smm * This code is free software; you can redistribute it and/or modify it 6228753Smm * under the terms of the GNU General Public License version 2 only, as 7228753Smm * published by the Free Software Foundation. Oracle designates this 8228753Smm * particular file as subject to the "Classpath" exception as provided 9228753Smm * by Oracle in the LICENSE file that accompanied this code. 10228753Smm * 11228753Smm * This code is distributed in the hope that it will be useful, but WITHOUT 12228753Smm * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13228753Smm * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14228753Smm * version 2 for more details (a copy is included in the LICENSE file that 15228753Smm * accompanied this code). 16228753Smm * 17228753Smm * You should have received a copy of the GNU General Public License version 18228753Smm * 2 along with this work; if not, write to the Free Software Foundation, 19228753Smm * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20228753Smm * 21228753Smm * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22228753Smm * or visit www.oracle.com if you need additional information or have any 23228753Smm * questions. 24228753Smm */ 25228753Smm 26228753Smmpackage javax.lang.model.util; 27228763Smm 28228753Smmimport javax.annotation.processing.SupportedSourceVersion; 29228753Smmimport javax.lang.model.type.*; 30228753Smm 31228753Smmimport static javax.lang.model.SourceVersion.*; 32228753Smm 33228753Smm/** 34228753Smm * A skeletal visitor of types with default behavior appropriate for 35228753Smm * the {@link javax.lang.model.SourceVersion#RELEASE_8 RELEASE_8} 36228753Smm * source version. 37228753Smm * 38228753Smm * <p> <b>WARNING:</b> The {@code TypeVisitor} interface implemented 39228753Smm * by this class may have methods added to it in the future to 40228753Smm * accommodate new, currently unknown, language structures added to 41228753Smm * future versions of the Java™ programming language. 42228753Smm * Therefore, methods whose names begin with {@code "visit"} may be 43228753Smm * added to this class in the future; to avoid incompatibilities, 44228753Smm * classes which extend this class should not declare any instance 45228753Smm * methods with names beginning with {@code "visit"}. 46228753Smm * 47228753Smm * <p>When such a new visit method is added, the default 48228753Smm * implementation in this class will be to call the {@link 49228753Smm * #visitUnknown visitUnknown} method. A new abstract type visitor 50228753Smm * class will also be introduced to correspond to the new language 51228753Smm * level; this visitor will have different default behavior for the 52228753Smm * visit method in question. When the new visitor is introduced, all 53228753Smm * or portions of this visitor may be deprecated. 54368708Smm * 55228753Smm * @param <R> the return type of this visitor's methods. Use {@link 56228753Smm * Void} for visitors that do not need to return results. 57228753Smm * @param <P> the type of the additional parameter to this visitor's 58228753Smm * methods. Use {@code Void} for visitors that do not need an 59228753Smm * additional parameter. 60228753Smm * 61228753Smm * @see AbstractTypeVisitor6 62228753Smm * @see AbstractTypeVisitor7 63228753Smm * @see AbstractTypeVisitor9 64228753Smm * @since 1.8 65228753Smm */ 66228753Smm@SupportedSourceVersion(RELEASE_8) 67228753Smmpublic abstract class AbstractTypeVisitor8<R, P> extends AbstractTypeVisitor7<R, P> { 68228753Smm /** 69368708Smm * Constructor for concrete subclasses to call. 70368708Smm */ 71228753Smm protected AbstractTypeVisitor8() { 72228753Smm super(); 73228753Smm } 74228753Smm 75228753Smm /** 76228753Smm * Visits an {@code IntersectionType} in a manner defined by a subclass. 77228753Smm * 78228753Smm * @param t {@inheritDoc} 79228753Smm * @param p {@inheritDoc} 80228753Smm * @return the result of the visit as defined by a subclass 81228753Smm */ 82228753Smm @Override 83228753Smm public abstract R visitIntersection(IntersectionType t, P p); 84228753Smm} 85228753Smm