1 /*
2 * Copyright 2005-2006 Sun Microsystems, Inc. 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. Sun designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
42 * (or <i>invocation</i>) of the former.
43 * The distinction is most apparent with generic types,
44 * for which a single element can define a whole
45 * family of types. For example, the element
46 * {@code java.util.Set} corresponds to the parameterized types
47 * {@code java.util.Set<String>} and {@code java.util.Set<Number>}
48 * (and many others), and to the raw type {@code java.util.Set}.
49 *
50 * <p> Each method of this interface that returns a list of elements
51 * will return them in the order that is natural for the underlying
52 * source of program information. For example, if the underlying
53 * source of information is Java source code, then the elements will be
54 * returned in source code order.
55 *
56 * @author Joseph D. Darcy
57 * @author Scott Seligman
58 * @author Peter von der Ahé
59 * @see DeclaredType
60 * @since 1.6
61 */
62 public interface TypeElement extends Element {
63
64 /**
65 * Returns the <i>nesting kind</i> of this type element.
66 *
67 * @return the nesting kind of this type element
68 */
69 NestingKind getNestingKind();
70
71 /**
72 * Returns the fully qualified name of this type element.
73 * More precisely, it returns the <i>canonical</i> name.
74 * For local and anonymous classes, which do not have canonical names,
75 * an empty name is returned.
76 *
77 * <p>The name of a generic type does not include any reference
78 * to its formal type parameters.
79 * For example, the fully qualified name of the interface
80 * {@code java.util.Set<E>} is "{@code java.util.Set}".
81 * Nested types use "{@code .}" as a separator, as in
82 * "{@code java.util.Map.Entry}".
|
1 /*
2 * Copyright 2005-2009 Sun Microsystems, Inc. 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. Sun designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
42 * (or <i>invocation</i>) of the former.
43 * The distinction is most apparent with generic types,
44 * for which a single element can define a whole
45 * family of types. For example, the element
46 * {@code java.util.Set} corresponds to the parameterized types
47 * {@code java.util.Set<String>} and {@code java.util.Set<Number>}
48 * (and many others), and to the raw type {@code java.util.Set}.
49 *
50 * <p> Each method of this interface that returns a list of elements
51 * will return them in the order that is natural for the underlying
52 * source of program information. For example, if the underlying
53 * source of information is Java source code, then the elements will be
54 * returned in source code order.
55 *
56 * @author Joseph D. Darcy
57 * @author Scott Seligman
58 * @author Peter von der Ahé
59 * @see DeclaredType
60 * @since 1.6
61 */
62 public interface TypeElement extends Element, Parameterizable, QualifiedNameable {
63
64 /**
65 * Returns the <i>nesting kind</i> of this type element.
66 *
67 * @return the nesting kind of this type element
68 */
69 NestingKind getNestingKind();
70
71 /**
72 * Returns the fully qualified name of this type element.
73 * More precisely, it returns the <i>canonical</i> name.
74 * For local and anonymous classes, which do not have canonical names,
75 * an empty name is returned.
76 *
77 * <p>The name of a generic type does not include any reference
78 * to its formal type parameters.
79 * For example, the fully qualified name of the interface
80 * {@code java.util.Set<E>} is "{@code java.util.Set}".
81 * Nested types use "{@code .}" as a separator, as in
82 * "{@code java.util.Map.Entry}".
|