AbstractElementVisitor9.java revision 3294:9adfb22ff08f
124417Sbrian/* 224417Sbrian * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. 324417Sbrian * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 424417Sbrian * 524417Sbrian * This code is free software; you can redistribute it and/or modify it 624417Sbrian * under the terms of the GNU General Public License version 2 only, as 724417Sbrian * published by the Free Software Foundation. Oracle designates this 824417Sbrian * particular file as subject to the "Classpath" exception as provided 924417Sbrian * by Oracle in the LICENSE file that accompanied this code. 1024417Sbrian * 1124417Sbrian * This code is distributed in the hope that it will be useful, but WITHOUT 1224417Sbrian * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1324417Sbrian * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1424417Sbrian * version 2 for more details (a copy is included in the LICENSE file that 1524417Sbrian * accompanied this code). 1624417Sbrian * 1724417Sbrian * You should have received a copy of the GNU General Public License version 1824417Sbrian * 2 along with this work; if not, write to the Free Software Foundation, 1924417Sbrian * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2024417Sbrian * 2124417Sbrian * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2224417Sbrian * or visit www.oracle.com if you need additional information or have any 2324417Sbrian * questions. 2424417Sbrian */ 2524417Sbrian 2624417Sbrianpackage javax.lang.model.util; 2724417Sbrian 2824417Sbrianimport javax.annotation.processing.SupportedSourceVersion; 2924417Sbrianimport javax.lang.model.SourceVersion; 3024417Sbrianimport javax.lang.model.element.ModuleElement; 3124417Sbrianimport static javax.lang.model.SourceVersion.*; 3224417Sbrian 3324417Sbrian 3484225Sdillon/** 3584225Sdillon * A skeletal visitor of program elements with default behavior 3684225Sdillon * appropriate for the {@link SourceVersion#RELEASE_9 RELEASE_9} 3724417Sbrian * source version. 3824417Sbrian * 3924417Sbrian * <p> <b>WARNING:</b> The {@code ElementVisitor} interface 4024417Sbrian * implemented by this class may have methods added to it in the 4124417Sbrian * future to accommodate new, currently unknown, language structures 4224417Sbrian * added to future versions of the Java™ programming language. 4324417Sbrian * Therefore, methods whose names begin with {@code "visit"} may be 4424417Sbrian * added to this class in the future; to avoid incompatibilities, 4524417Sbrian * classes which extend this class should not declare any instance 4624417Sbrian * methods with names beginning with {@code "visit"}. 4724417Sbrian * 4824417Sbrian * <p>When such a new visit method is added, the default 4924417Sbrian * implementation in this class will be to call the {@link 5024461Sbrian * #visitUnknown visitUnknown} method. A new abstract element visitor 5124461Sbrian * class will also be introduced to correspond to the new language 5224417Sbrian * level; this visitor will have different default behavior for the 5328040Sache * visit method in question. When the new visitor is introduced, all 5428040Sache * or portions of this visitor may be deprecated. 5528040Sache * 5624417Sbrian * @param <R> the return type of this visitor's methods. Use {@link 5724417Sbrian * Void} for visitors that do not need to return results. 5828040Sache * @param <P> the type of the additional parameter to this visitor's 5928040Sache * methods. Use {@code Void} for visitors that do not need an 6028040Sache * additional parameter. 6124417Sbrian * 6224417Sbrian * @see AbstractElementVisitor6 6324461Sbrian * @see AbstractElementVisitor7 6424417Sbrian * @see AbstractElementVisitor8 6524417Sbrian * @since 9 6624417Sbrian */ 6724417Sbrian@SupportedSourceVersion(RELEASE_9) 6824417Sbrianpublic abstract class AbstractElementVisitor9<R, P> extends AbstractElementVisitor8<R, P> { 6936451Sbrian /** 7036451Sbrian * Constructor for concrete subclasses to call. 7124417Sbrian */ 7228040Sache protected AbstractElementVisitor9(){ 7344652Sbrian super(); 7428040Sache } 7528040Sache 7628040Sache /** 7724417Sbrian * Visits a {@code ModuleElement} in a manner defined by a 7828040Sache * subclass. 7928040Sache * 8028040Sache * @param t {@inheritDoc} 8128040Sache * @param p {@inheritDoc} 8228040Sache * @return the result of the visit as defined by a subclass 8328040Sache */ 8428040Sache @Override 8524461Sbrian public abstract R visitModule(ModuleElement t, P p); 8628040Sache} 8728040Sache