Tue, 22 Oct 2013 17:42:10 -0700
8027119: Cleanup javadoc comments for taglet API
Reviewed-by: mduigou
duke@1 | 1 | /* |
ohair@554 | 2 | * Copyright (c) 1997, 2003, 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 | * This is an example of a starting class for a doclet, |
duke@1 | 30 | * showing the entry-point methods. A starting class must |
duke@1 | 31 | * import com.sun.javadoc.* and implement the |
duke@1 | 32 | * <code>start(RootDoc)</code> method, as described in the |
duke@1 | 33 | * <a href="package-summary.html#package_description">package |
duke@1 | 34 | * description</a>. If the doclet takes command line options, |
duke@1 | 35 | * it must also implement <code>optionLength</code> and |
duke@1 | 36 | * <code>validOptions</code>. |
duke@1 | 37 | * |
duke@1 | 38 | * <p> A doclet supporting the language features added since 1.1 |
duke@1 | 39 | * (such as generics and annotations) should indicate this |
duke@1 | 40 | * by implementing <code>languageVersion</code>. In the absence of |
duke@1 | 41 | * this the doclet should not invoke any of the Doclet API methods |
duke@1 | 42 | * added since 1.5, and |
duke@1 | 43 | * the results of several other methods are modified so as |
duke@1 | 44 | * to conceal the new constructs (such as type parameters) from |
duke@1 | 45 | * the doclet. |
duke@1 | 46 | * |
duke@1 | 47 | * <p> To start the doclet, pass |
duke@1 | 48 | * <code>-doclet</code> followed by the fully-qualified |
duke@1 | 49 | * name of the starting class on the javadoc tool command line. |
duke@1 | 50 | */ |
duke@1 | 51 | public abstract class Doclet { |
duke@1 | 52 | |
duke@1 | 53 | /** |
duke@1 | 54 | * Generate documentation here. |
duke@1 | 55 | * This method is required for all doclets. |
duke@1 | 56 | * |
duke@1 | 57 | * @return true on success. |
duke@1 | 58 | */ |
duke@1 | 59 | public static boolean start(RootDoc root) { |
duke@1 | 60 | return true; |
duke@1 | 61 | } |
duke@1 | 62 | |
duke@1 | 63 | /** |
duke@1 | 64 | * Check for doclet-added options. Returns the number of |
duke@1 | 65 | * arguments you must specify on the command line for the |
duke@1 | 66 | * given option. For example, "-d docs" would return 2. |
duke@1 | 67 | * <P> |
duke@1 | 68 | * This method is required if the doclet contains any options. |
duke@1 | 69 | * If this method is missing, Javadoc will print an invalid flag |
duke@1 | 70 | * error for every option. |
duke@1 | 71 | * |
duke@1 | 72 | * @return number of arguments on the command line for an option |
duke@1 | 73 | * including the option name itself. Zero return means |
duke@1 | 74 | * option not known. Negative value means error occurred. |
duke@1 | 75 | */ |
duke@1 | 76 | public static int optionLength(String option) { |
duke@1 | 77 | return 0; // default is option unknown |
duke@1 | 78 | } |
duke@1 | 79 | |
duke@1 | 80 | /** |
duke@1 | 81 | * Check that options have the correct arguments. |
duke@1 | 82 | * <P> |
duke@1 | 83 | * This method is not required, but is recommended, |
duke@1 | 84 | * as every option will be considered valid if this method |
duke@1 | 85 | * is not present. It will default gracefully (to true) |
duke@1 | 86 | * if absent. |
duke@1 | 87 | * <P> |
duke@1 | 88 | * Printing option related error messages (using the provided |
duke@1 | 89 | * DocErrorReporter) is the responsibility of this method. |
duke@1 | 90 | * |
duke@1 | 91 | * @return true if the options are valid. |
duke@1 | 92 | */ |
duke@1 | 93 | public static boolean validOptions(String options[][], |
duke@1 | 94 | DocErrorReporter reporter) { |
duke@1 | 95 | return true; // default is options are valid |
duke@1 | 96 | } |
duke@1 | 97 | |
duke@1 | 98 | /** |
duke@1 | 99 | * Return the version of the Java Programming Language supported |
duke@1 | 100 | * by this doclet. |
duke@1 | 101 | * <p> |
duke@1 | 102 | * This method is required by any doclet supporting a language version |
duke@1 | 103 | * newer than 1.1. |
duke@1 | 104 | * |
duke@1 | 105 | * @return the language version supported by this doclet. |
duke@1 | 106 | * @since 1.5 |
duke@1 | 107 | */ |
duke@1 | 108 | public static LanguageVersion languageVersion() { |
duke@1 | 109 | return LanguageVersion.JAVA_1_1; |
duke@1 | 110 | } |
duke@1 | 111 | } |