src/jdk.javadoc/share/classes/com/sun/javadoc/Doclet.java
branchniosocketimpl-branch
changeset 57208 7a45c67e73d0
parent 57207 30695f27d7ea
parent 53902 7a6fd71449e7
child 57210 a67ea4f53e56
equal deleted inserted replaced
57207:30695f27d7ea 57208:7a45c67e73d0
     1 /*
       
     2  * Copyright (c) 1997, 2018, 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
       
    23  * questions.
       
    24  */
       
    25 
       
    26 package com.sun.javadoc;
       
    27 
       
    28 /**
       
    29  * This is an example of a starting class for a doclet,
       
    30  * showing the entry-point methods.  A starting class must
       
    31  * import com.sun.javadoc.* and implement the
       
    32  * {@code start(RootDoc)} method, as described in the
       
    33  * <a href="package-summary.html#package.description">package
       
    34  * description</a>.  If the doclet takes command line options,
       
    35  * it must also implement {@code optionLength} and
       
    36  * {@code validOptions}.
       
    37  *
       
    38  * <p> A doclet supporting the language features added since 1.1
       
    39  * (such as generics and annotations) should indicate this
       
    40  * by implementing {@code languageVersion}.  In the absence of
       
    41  * this the doclet should not invoke any of the Doclet API methods
       
    42  * added since 1.5, and
       
    43  * the results of several other methods are modified so as
       
    44  * to conceal the new constructs (such as type parameters) from
       
    45  * the doclet.
       
    46  *
       
    47  * <p> To start the doclet, pass
       
    48  * {@code -doclet} followed by the fully-qualified
       
    49  * name of the starting class on the javadoc tool command line.
       
    50  *
       
    51  * @deprecated
       
    52  *   The declarations in this package have been superseded by those
       
    53  *   in the package {@code jdk.javadoc.doclet}.
       
    54  *   For more information, see the <i>Migration Guide</i> in the documentation for that package.
       
    55  */
       
    56 @Deprecated(since="9", forRemoval=true)
       
    57 @SuppressWarnings("removal")
       
    58 public abstract class Doclet {
       
    59 
       
    60     /**
       
    61      * Generate documentation here.
       
    62      * This method is required for all doclets.
       
    63      *
       
    64      * @param root Supply the RootDoc to the method.
       
    65      * @return true on success.
       
    66      */
       
    67     public static boolean start(RootDoc root) {
       
    68         return true;
       
    69     }
       
    70 
       
    71     /**
       
    72      * Check for doclet-added options.  Returns the number of
       
    73      * arguments you must specify on the command line for the
       
    74      * given option.  For example, "-d docs" would return 2.
       
    75      * <P>
       
    76      * This method is required if the doclet contains any options.
       
    77      * If this method is missing, Javadoc will print an invalid flag
       
    78      * error for every option.
       
    79      *
       
    80      * @param option the option for which the number of arguements is returned.
       
    81      * @return number of arguments on the command line for an option
       
    82      *         including the option name itself.  Zero return means
       
    83      *         option not known.  Negative value means error occurred.
       
    84      */
       
    85     public static int optionLength(String option) {
       
    86         return 0;  // default is option unknown
       
    87     }
       
    88 
       
    89     /**
       
    90      * Check that options have the correct arguments.
       
    91      * <P>
       
    92      * This method is not required, but is recommended,
       
    93      * as every option will be considered valid if this method
       
    94      * is not present.  It will default gracefully (to true)
       
    95      * if absent.
       
    96      * <P>
       
    97      * Printing option related error messages (using the provided
       
    98      * DocErrorReporter) is the responsibility of this method.
       
    99      *
       
   100      * @param options Supply valid options as an array of Strings.
       
   101      * @param reporter The DocErrorReporter responsible for these options.
       
   102      * @return true if the options are valid.
       
   103      */
       
   104     public static boolean validOptions(String options[][],
       
   105                                        DocErrorReporter reporter) {
       
   106         return true;  // default is options are valid
       
   107     }
       
   108 
       
   109     /**
       
   110      * Return the version of the Java Programming Language supported
       
   111      * by this doclet.
       
   112      * <p>
       
   113      * This method is required by any doclet supporting a language version
       
   114      * newer than 1.1.
       
   115      *
       
   116      * @return  the language version supported by this doclet.
       
   117      * @since 1.5
       
   118      */
       
   119     public static LanguageVersion languageVersion() {
       
   120         return LanguageVersion.JAVA_1_1;
       
   121     }
       
   122 }