1 /*
2 * Copyright (c) 2005, 2009, Oracle and/or its affiliates. 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. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
88 * Returns the fully qualified name of this type element.
89 * More precisely, it returns the <i>canonical</i> name.
90 * For local and anonymous classes, which do not have canonical names,
91 * an empty name is returned.
92 *
93 * <p>The name of a generic type does not include any reference
94 * to its formal type parameters.
95 * For example, the fully qualified name of the interface
96 * {@code java.util.Set<E>} is "{@code java.util.Set}".
97 * Nested types use "{@code .}" as a separator, as in
98 * "{@code java.util.Map.Entry}".
99 *
100 * @return the fully qualified name of this class or interface, or
101 * an empty name if none
102 *
103 * @see Elements#getBinaryName
104 * @jls3 6.7 Fully Qualified Names and Canonical Names
105 */
106 Name getQualifiedName();
107
108 /**
109 * Returns the direct superclass of this type element.
110 * If this type element represents an interface or the class
111 * {@code java.lang.Object}, then a {@link NoType}
112 * with kind {@link TypeKind#NONE NONE} is returned.
113 *
114 * @return the direct superclass, or a {@code NoType} if there is none
115 */
116 TypeMirror getSuperclass();
117
118 /**
119 * Returns the interface types directly implemented by this class
120 * or extended by this interface.
121 *
122 * @return the interface types directly implemented by this class
123 * or extended by this interface, or an empty list if there are none
124 */
125 List<? extends TypeMirror> getInterfaces();
126
127 /**
128 * Returns the formal type parameters of this type element
129 * in declaration order.
130 *
131 * @return the formal type parameters, or an empty list
132 * if there are none
133 */
134 List<? extends TypeParameterElement> getTypeParameters();
135 }
|
1 /*
2 * Copyright (c) 2005, 2011, Oracle and/or its affiliates. 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. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
88 * Returns the fully qualified name of this type element.
89 * More precisely, it returns the <i>canonical</i> name.
90 * For local and anonymous classes, which do not have canonical names,
91 * an empty name is returned.
92 *
93 * <p>The name of a generic type does not include any reference
94 * to its formal type parameters.
95 * For example, the fully qualified name of the interface
96 * {@code java.util.Set<E>} is "{@code java.util.Set}".
97 * Nested types use "{@code .}" as a separator, as in
98 * "{@code java.util.Map.Entry}".
99 *
100 * @return the fully qualified name of this class or interface, or
101 * an empty name if none
102 *
103 * @see Elements#getBinaryName
104 * @jls3 6.7 Fully Qualified Names and Canonical Names
105 */
106 Name getQualifiedName();
107
108
109 /**
110 * Returns the simple name of this type element.
111 *
112 * For an anonymous class, an empty name is returned.
113 *
114 * @return the simple name of this class or interface,
115 * an empty name for an anonymous class
116 *
117 */
118 @Override
119 Name getSimpleName();
120
121 /**
122 * Returns the direct superclass of this type element.
123 * If this type element represents an interface or the class
124 * {@code java.lang.Object}, then a {@link NoType}
125 * with kind {@link TypeKind#NONE NONE} is returned.
126 *
127 * @return the direct superclass, or a {@code NoType} if there is none
128 */
129 TypeMirror getSuperclass();
130
131 /**
132 * Returns the interface types directly implemented by this class
133 * or extended by this interface.
134 *
135 * @return the interface types directly implemented by this class
136 * or extended by this interface, or an empty list if there are none
137 */
138 List<? extends TypeMirror> getInterfaces();
139
140 /**
141 * Returns the formal type parameters of this type element
142 * in declaration order.
143 *
144 * @return the formal type parameters, or an empty list
145 * if there are none
146 */
147 List<? extends TypeParameterElement> getTypeParameters();
148
149
150 /**
151 * Returns the package of a top-level type and the immediately
152 * lexically enclosing element for a {@linkplain
153 * NestingKind#isNested nested} type.
154 *
155 * @return the package of a top-level type and the immediately
156 * lexically enclosing element for a nested type
157 */
158 @Override
159 Element getEnclosingElement();
160 }
|