Tue, 22 Oct 2013 17:42:10 -0700
8027119: Cleanup javadoc comments for taglet API
Reviewed-by: mduigou
duke@1 | 1 | /* |
vromero@1454 | 2 | * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. |
duke@1 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@1 | 4 | * |
duke@1 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@1 | 6 | * under the terms of the GNU General Public License version 2 only, as |
ohair@554 | 7 | * published by the Free Software Foundation. Oracle designates this |
duke@1 | 8 | * particular file as subject to the "Classpath" exception as provided |
ohair@554 | 9 | * by Oracle in the LICENSE file that accompanied this code. |
duke@1 | 10 | * |
duke@1 | 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@1 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@1 | 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@1 | 14 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@1 | 15 | * accompanied this code). |
duke@1 | 16 | * |
duke@1 | 17 | * You should have received a copy of the GNU General Public License version |
duke@1 | 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@1 | 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@1 | 20 | * |
ohair@554 | 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@554 | 22 | * or visit www.oracle.com if you need additional information or have any |
ohair@554 | 23 | * questions. |
duke@1 | 24 | */ |
duke@1 | 25 | |
duke@1 | 26 | package com.sun.javadoc; |
duke@1 | 27 | |
duke@1 | 28 | |
duke@1 | 29 | /** |
duke@1 | 30 | * Represents a java class or interface and provides access to |
duke@1 | 31 | * information about the class, the class's comment and tags, and the |
duke@1 | 32 | * members of the class. A ClassDoc only exists if it was |
duke@1 | 33 | * processed in this run of javadoc. References to classes |
duke@1 | 34 | * which may or may not have been processed in this run are |
duke@1 | 35 | * referred to using Type (which can be converted to ClassDoc, |
duke@1 | 36 | * if possible). |
duke@1 | 37 | * |
duke@1 | 38 | * @see Type |
duke@1 | 39 | * |
duke@1 | 40 | * @since 1.2 |
duke@1 | 41 | * @author Kaiyang Liu (original) |
duke@1 | 42 | * @author Robert Field (rewrite) |
duke@1 | 43 | */ |
duke@1 | 44 | public interface ClassDoc extends ProgramElementDoc, Type { |
duke@1 | 45 | |
duke@1 | 46 | /** |
duke@1 | 47 | * Return true if this class is abstract. Return true |
duke@1 | 48 | * for all interfaces. |
duke@1 | 49 | */ |
duke@1 | 50 | boolean isAbstract(); |
duke@1 | 51 | |
duke@1 | 52 | /** |
duke@1 | 53 | * Return true if this class implements or interface extends |
duke@1 | 54 | * <code>java.io.Serializable</code>. |
duke@1 | 55 | * |
duke@1 | 56 | * Since <code>java.io.Externalizable</code> extends |
duke@1 | 57 | * <code>java.io.Serializable</code>, |
duke@1 | 58 | * Externalizable objects are also Serializable. |
duke@1 | 59 | */ |
duke@1 | 60 | boolean isSerializable(); |
duke@1 | 61 | |
duke@1 | 62 | /** |
duke@1 | 63 | * Return true if this class implements or interface extends |
duke@1 | 64 | * <code>java.io.Externalizable</code>. |
duke@1 | 65 | */ |
duke@1 | 66 | boolean isExternalizable(); |
duke@1 | 67 | |
duke@1 | 68 | /** |
vromero@1454 | 69 | * Return true if this class can be used as a target type of a lambda expression |
vromero@1454 | 70 | * or method reference. |
vromero@1454 | 71 | */ |
vromero@1454 | 72 | boolean isFunctionalInterface(); |
vromero@1454 | 73 | |
vromero@1454 | 74 | /** |
duke@1 | 75 | * Return the serialization methods for this class or |
duke@1 | 76 | * interface. |
duke@1 | 77 | * |
duke@1 | 78 | * @return an array of MethodDoc objects that represents |
duke@1 | 79 | * the serialization methods for this class or interface. |
duke@1 | 80 | */ |
duke@1 | 81 | MethodDoc[] serializationMethods(); |
duke@1 | 82 | |
duke@1 | 83 | /** |
duke@1 | 84 | * Return the Serializable fields of this class or interface. |
duke@1 | 85 | * <p> |
duke@1 | 86 | * Return either a list of default fields documented by |
duke@1 | 87 | * <code>serial</code> tag<br> |
duke@1 | 88 | * or return a single <code>FieldDoc</code> for |
duke@1 | 89 | * <code>serialPersistentField</code> member. |
duke@1 | 90 | * There should be a <code>serialField</code> tag for |
duke@1 | 91 | * each Serializable field defined by an <code>ObjectStreamField</code> |
duke@1 | 92 | * array component of <code>serialPersistentField</code>. |
duke@1 | 93 | * |
duke@1 | 94 | * @return an array of <code>FieldDoc</code> objects for the Serializable |
duke@1 | 95 | * fields of this class or interface. |
duke@1 | 96 | * |
duke@1 | 97 | * @see #definesSerializableFields() |
duke@1 | 98 | * @see SerialFieldTag |
duke@1 | 99 | */ |
duke@1 | 100 | FieldDoc[] serializableFields(); |
duke@1 | 101 | |
duke@1 | 102 | /** |
duke@1 | 103 | * Return true if Serializable fields are explicitly defined with |
duke@1 | 104 | * the special class member <code>serialPersistentFields</code>. |
duke@1 | 105 | * |
duke@1 | 106 | * @see #serializableFields() |
duke@1 | 107 | * @see SerialFieldTag |
duke@1 | 108 | */ |
duke@1 | 109 | boolean definesSerializableFields(); |
duke@1 | 110 | |
duke@1 | 111 | /** |
duke@1 | 112 | * Return the superclass of this class. Return null if this is an |
duke@1 | 113 | * interface. |
duke@1 | 114 | * |
duke@1 | 115 | * <p> <i>This method cannot accommodate certain generic type constructs. |
duke@1 | 116 | * The <code>superclassType</code> method should be used instead.</i> |
duke@1 | 117 | * |
duke@1 | 118 | * @return the ClassDoc for the superclass of this class, null if |
duke@1 | 119 | * there is no superclass. |
duke@1 | 120 | * @see #superclassType |
duke@1 | 121 | */ |
duke@1 | 122 | ClassDoc superclass(); |
duke@1 | 123 | |
duke@1 | 124 | /** |
duke@1 | 125 | * Return the superclass of this class. Return null if this is an |
duke@1 | 126 | * interface. A superclass is represented by either a |
duke@1 | 127 | * <code>ClassDoc</code> or a <code>ParametrizedType</code>. |
duke@1 | 128 | * |
duke@1 | 129 | * @return the superclass of this class, or null if there is no superclass. |
duke@1 | 130 | * @since 1.5 |
duke@1 | 131 | */ |
duke@1 | 132 | Type superclassType(); |
duke@1 | 133 | |
duke@1 | 134 | /** |
duke@1 | 135 | * Test whether this class is a subclass of the specified class. |
duke@1 | 136 | * If this is an interface, return false for all classes except |
duke@1 | 137 | * <code>java.lang.Object</code> (we must keep this unexpected |
duke@1 | 138 | * behavior for compatibility reasons). |
duke@1 | 139 | * |
duke@1 | 140 | * @param cd the candidate superclass. |
duke@1 | 141 | * @return true if cd is a superclass of this class. |
duke@1 | 142 | */ |
duke@1 | 143 | boolean subclassOf(ClassDoc cd); |
duke@1 | 144 | |
duke@1 | 145 | /** |
duke@1 | 146 | * Return interfaces implemented by this class or interfaces extended |
duke@1 | 147 | * by this interface. Includes only directly-declared interfaces, not |
duke@1 | 148 | * inherited interfaces. |
duke@1 | 149 | * Return an empty array if there are no interfaces. |
duke@1 | 150 | * |
duke@1 | 151 | * <p> <i>This method cannot accommodate certain generic type constructs. |
duke@1 | 152 | * The <code>interfaceTypes</code> method should be used instead.</i> |
duke@1 | 153 | * |
duke@1 | 154 | * @return an array of ClassDoc objects representing the interfaces. |
duke@1 | 155 | * @see #interfaceTypes |
duke@1 | 156 | */ |
duke@1 | 157 | ClassDoc[] interfaces(); |
duke@1 | 158 | |
duke@1 | 159 | /** |
duke@1 | 160 | * Return interfaces implemented by this class or interfaces extended |
duke@1 | 161 | * by this interface. Includes only directly-declared interfaces, not |
duke@1 | 162 | * inherited interfaces. |
duke@1 | 163 | * Return an empty array if there are no interfaces. |
duke@1 | 164 | * |
duke@1 | 165 | * @return an array of interfaces, each represented by a |
duke@1 | 166 | * <code>ClassDoc</code> or a <code>ParametrizedType</code>. |
duke@1 | 167 | * @since 1.5 |
duke@1 | 168 | */ |
duke@1 | 169 | Type[] interfaceTypes(); |
duke@1 | 170 | |
duke@1 | 171 | /** |
duke@1 | 172 | * Return the formal type parameters of this class or interface. |
duke@1 | 173 | * Return an empty array if there are none. |
duke@1 | 174 | * |
duke@1 | 175 | * @return the formal type parameters of this class or interface. |
duke@1 | 176 | * @since 1.5 |
duke@1 | 177 | */ |
duke@1 | 178 | TypeVariable[] typeParameters(); |
duke@1 | 179 | |
duke@1 | 180 | /** |
duke@1 | 181 | * Return the type parameter tags of this class or interface. |
duke@1 | 182 | * Return an empty array if there are none. |
duke@1 | 183 | * |
duke@1 | 184 | * @return the type parameter tags of this class or interface. |
duke@1 | 185 | * @since 1.5 |
duke@1 | 186 | */ |
duke@1 | 187 | ParamTag[] typeParamTags(); |
duke@1 | 188 | |
duke@1 | 189 | /** |
duke@1 | 190 | * Return |
duke@1 | 191 | * <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">included</a> |
duke@1 | 192 | * fields in this class or interface. |
duke@1 | 193 | * Excludes enum constants if this is an enum type. |
duke@1 | 194 | * |
duke@1 | 195 | * @return an array of FieldDoc objects representing the included |
duke@1 | 196 | * fields in this class or interface. |
duke@1 | 197 | */ |
duke@1 | 198 | FieldDoc[] fields(); |
duke@1 | 199 | |
duke@1 | 200 | /** |
duke@1 | 201 | * Return fields in this class or interface, filtered to the specified |
duke@1 | 202 | * <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">access |
duke@1 | 203 | * modifier option</a>. |
duke@1 | 204 | * Excludes enum constants if this is an enum type. |
duke@1 | 205 | * |
duke@1 | 206 | * @param filter Specify true to filter according to the specified access |
duke@1 | 207 | * modifier option. |
duke@1 | 208 | * Specify false to include all fields regardless of |
duke@1 | 209 | * access modifier option. |
duke@1 | 210 | * @return an array of FieldDoc objects representing the included |
duke@1 | 211 | * fields in this class or interface. |
duke@1 | 212 | */ |
duke@1 | 213 | FieldDoc[] fields(boolean filter); |
duke@1 | 214 | |
duke@1 | 215 | /** |
duke@1 | 216 | * Return the enum constants if this is an enum type. |
duke@1 | 217 | * Return an empty array if there are no enum constants, or if |
duke@1 | 218 | * this is not an enum type. |
duke@1 | 219 | * |
duke@1 | 220 | * @return the enum constants if this is an enum type. |
duke@1 | 221 | */ |
duke@1 | 222 | FieldDoc[] enumConstants(); |
duke@1 | 223 | |
duke@1 | 224 | /** |
duke@1 | 225 | * Return |
duke@1 | 226 | * <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">included</a> |
duke@1 | 227 | * methods in this class or interface. |
duke@1 | 228 | * Same as <code>methods(true)</code>. |
duke@1 | 229 | * |
duke@1 | 230 | * @return an array of MethodDoc objects representing the included |
duke@1 | 231 | * methods in this class or interface. Does not include |
duke@1 | 232 | * constructors or annotation type elements. |
duke@1 | 233 | */ |
duke@1 | 234 | MethodDoc[] methods(); |
duke@1 | 235 | |
duke@1 | 236 | /** |
duke@1 | 237 | * Return methods in this class or interface, filtered to the specified |
duke@1 | 238 | * <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">access |
duke@1 | 239 | * modifier option</a>. Does not include constructors or annotation |
duke@1 | 240 | * type elements. |
duke@1 | 241 | * |
duke@1 | 242 | * @param filter Specify true to filter according to the specified access |
duke@1 | 243 | * modifier option. |
duke@1 | 244 | * Specify false to include all methods regardless of |
duke@1 | 245 | * access modifier option. |
duke@1 | 246 | * @return an array of MethodDoc objects representing the included |
duke@1 | 247 | * methods in this class or interface. |
duke@1 | 248 | */ |
duke@1 | 249 | MethodDoc[] methods(boolean filter); |
duke@1 | 250 | |
duke@1 | 251 | /** |
duke@1 | 252 | * Return |
duke@1 | 253 | * <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">included</a> |
duke@1 | 254 | * constructors in this class. An array containing the default |
duke@1 | 255 | * no-arg constructor is returned if no other constructors exist. |
duke@1 | 256 | * Return empty array if this is an interface. |
duke@1 | 257 | * |
duke@1 | 258 | * @return an array of ConstructorDoc objects representing the included |
duke@1 | 259 | * constructors in this class. |
duke@1 | 260 | */ |
duke@1 | 261 | ConstructorDoc[] constructors(); |
duke@1 | 262 | |
duke@1 | 263 | /** |
duke@1 | 264 | * Return constructors in this class, filtered to the specified |
duke@1 | 265 | * <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">access |
duke@1 | 266 | * modifier option</a>. Return an array containing the default |
duke@1 | 267 | * no-arg constructor if no other constructors exist. |
duke@1 | 268 | * |
duke@1 | 269 | * @param filter Specify true to filter according to the specified access |
duke@1 | 270 | * modifier option. |
duke@1 | 271 | * Specify false to include all constructors regardless of |
duke@1 | 272 | * access modifier option. |
duke@1 | 273 | * @return an array of ConstructorDoc objects representing the included |
duke@1 | 274 | * constructors in this class. |
duke@1 | 275 | */ |
duke@1 | 276 | ConstructorDoc[] constructors(boolean filter); |
duke@1 | 277 | |
duke@1 | 278 | |
duke@1 | 279 | /** |
duke@1 | 280 | * Return |
duke@1 | 281 | * <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">included</a> |
duke@1 | 282 | * nested classes and interfaces within this class or interface. |
duke@1 | 283 | * This includes both static and non-static nested classes. |
duke@1 | 284 | * (This method should have been named <code>nestedClasses()</code>, |
duke@1 | 285 | * as inner classes are technically non-static.) Anonymous and local classes |
duke@1 | 286 | * or interfaces are not included. |
duke@1 | 287 | * |
duke@1 | 288 | * @return an array of ClassDoc objects representing the included classes |
duke@1 | 289 | * and interfaces defined in this class or interface. |
duke@1 | 290 | */ |
duke@1 | 291 | ClassDoc[] innerClasses(); |
duke@1 | 292 | |
duke@1 | 293 | /** |
duke@1 | 294 | * Return nested classes and interfaces within this class or interface |
duke@1 | 295 | * filtered to the specified |
duke@1 | 296 | * <a href="{@docRoot}/com/sun/javadoc/package-summary.html#included">access |
duke@1 | 297 | * modifier option</a>. |
duke@1 | 298 | * This includes both static and non-static nested classes. |
duke@1 | 299 | * Anonymous and local classes are not included. |
duke@1 | 300 | * |
duke@1 | 301 | * @param filter Specify true to filter according to the specified access |
duke@1 | 302 | * modifier option. |
duke@1 | 303 | * Specify false to include all nested classes regardless of |
duke@1 | 304 | * access modifier option. |
duke@1 | 305 | * @return a filtered array of ClassDoc objects representing the included |
duke@1 | 306 | * classes and interfaces defined in this class or interface. |
duke@1 | 307 | */ |
duke@1 | 308 | ClassDoc[] innerClasses(boolean filter); |
duke@1 | 309 | |
duke@1 | 310 | /** |
duke@1 | 311 | * Find the specified class or interface within the context of this class doc. |
duke@1 | 312 | * Search order: 1) qualified name, 2) nested in this class or interface, |
duke@1 | 313 | * 3) in this package, 4) in the class imports, 5) in the package imports. |
duke@1 | 314 | * Return the ClassDoc if found, null if not found. |
duke@1 | 315 | */ |
duke@1 | 316 | ClassDoc findClass(String className); |
duke@1 | 317 | |
duke@1 | 318 | /** |
duke@1 | 319 | * Get the list of classes and interfaces declared as imported. |
jjh@972 | 320 | * These are called "single-type-import declarations" in |
jjh@972 | 321 | * <cite>The Java™ Language Specification</cite>. |
duke@1 | 322 | * |
duke@1 | 323 | * @return an array of ClassDoc representing the imported classes. |
duke@1 | 324 | * |
duke@1 | 325 | * @deprecated Import declarations are implementation details that |
duke@1 | 326 | * should not be exposed here. In addition, not all imported |
duke@1 | 327 | * classes are imported through single-type-import declarations. |
duke@1 | 328 | */ |
duke@1 | 329 | @Deprecated |
duke@1 | 330 | ClassDoc[] importedClasses(); |
duke@1 | 331 | |
duke@1 | 332 | /** |
duke@1 | 333 | * Get the list of packages declared as imported. |
jjh@972 | 334 | * These are called "type-import-on-demand declarations" in |
jjh@972 | 335 | * <cite>The Java™ Language Specification</cite>. |
duke@1 | 336 | * |
duke@1 | 337 | * @return an array of PackageDoc representing the imported packages. |
duke@1 | 338 | * |
duke@1 | 339 | * @deprecated Import declarations are implementation details that |
duke@1 | 340 | * should not be exposed here. In addition, this method's |
duke@1 | 341 | * return type does not allow for all type-import-on-demand |
duke@1 | 342 | * declarations to be returned. |
duke@1 | 343 | */ |
duke@1 | 344 | @Deprecated |
duke@1 | 345 | PackageDoc[] importedPackages(); |
duke@1 | 346 | } |