duke@1: /* duke@1: * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. duke@1: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@1: * duke@1: * This code is free software; you can redistribute it and/or modify it duke@1: * under the terms of the GNU General Public License version 2 only, as duke@1: * published by the Free Software Foundation. Sun designates this duke@1: * particular file as subject to the "Classpath" exception as provided duke@1: * by Sun in the LICENSE file that accompanied this code. duke@1: * duke@1: * This code is distributed in the hope that it will be useful, but WITHOUT duke@1: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@1: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@1: * version 2 for more details (a copy is included in the LICENSE file that duke@1: * accompanied this code). duke@1: * duke@1: * You should have received a copy of the GNU General Public License version duke@1: * 2 along with this work; if not, write to the Free Software Foundation, duke@1: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@1: * duke@1: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, duke@1: * CA 95054 USA or visit www.sun.com if you need additional information or duke@1: * have any questions. duke@1: */ duke@1: duke@1: package javax.lang.model.type; duke@1: duke@1: import javax.lang.model.element.*; duke@1: duke@1: /** duke@1: * A visitor of types, in the style of the duke@1: * visitor design pattern. Classes implementing this duke@1: * interface are used to operate on a type when the kind of duke@1: * type is unknown at compile time. When a visitor is passed to a duke@1: * type's {@link TypeMirror#accept accept} method, the visitXYZ duke@1: * method most applicable to that type is invoked. duke@1: * duke@1: *
Classes implementing this interface may or may not throw a duke@1: * {@code NullPointerException} if the additional parameter {@code p} duke@1: * is {@code null}; see documentation of the implementing class for duke@1: * details. duke@1: * duke@1: *
WARNING: It is possible that methods will be added to
duke@1: * this interface to accommodate new, currently unknown, language
duke@1: * structures added to future versions of the Java™ programming
duke@1: * language. Therefore, visitor classes directly implementing this
duke@1: * interface may be source incompatible with future versions of the
duke@1: * platform. To avoid this source incompatibility, visitor
duke@1: * implementations are encouraged to instead extend the appropriate
duke@1: * abstract visitor class that implements this interface. However, an
duke@1: * API should generally use this visitor interface as the type for
duke@1: * parameters, return type, etc. rather than one of the abstract
duke@1: * classes.
duke@1: *
duke@1: * @param the type of the additional parameter to this visitor's
duke@1: * methods. Use {@code Void} for visitors that do not need an
duke@1: * additional parameter.
duke@1: *
duke@1: * @author Joseph D. Darcy
duke@1: * @author Scott Seligman
duke@1: * @author Peter von der Ahé
duke@1: * @since 1.6
duke@1: */
duke@1: public interface TypeVisitor