/* * Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Sun designates this * particular file as subject to the "Classpath" exception as provided * by Sun in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, * CA 95054 USA or visit www.sun.com if you need additional information or * have any questions. */ package javax.lang.model.element; import java.util.List; import javax.lang.model.type.*; import javax.lang.model.util.*; /** * Represents a class or interface program element. Provides access * to information about the type and its members. Note that an enum * type is a kind of class and an annotation type is a kind of * interface. * *
* While a {@code TypeElement} represents a class or interface
* element, a {@link DeclaredType} represents a class
* or interface type, the latter being a use
* (or invocation) of the former.
* The distinction is most apparent with generic types,
* for which a single element can define a whole
* family of types. For example, the element
* {@code java.util.Set} corresponds to the parameterized types
* {@code java.util.Set Each method of this interface that returns a list of elements
* will return them in the order that is natural for the underlying
* source of program information. For example, if the underlying
* source of information is Java source code, then the elements will be
* returned in source code order.
*
* @author Joseph D. Darcy
* @author Scott Seligman
* @author Peter von der Ahé
* @see DeclaredType
* @since 1.6
*/
public interface TypeElement extends Element, Parameterizable, QualifiedNameable {
/**
* Returns the nesting kind of this type element.
*
* @return the nesting kind of this type element
*/
NestingKind getNestingKind();
/**
* Returns the fully qualified name of this type element.
* More precisely, it returns the canonical name.
* For local and anonymous classes, which do not have canonical names,
* an empty name is returned.
*
* The name of a generic type does not include any reference
* to its formal type parameters.
* For example, the fully qualified name of the interface
* {@code java.util.Set