Path: blob/aarch64-shenandoah-jdk8u272-b10/langtools/src/share/classes/com/sun/javadoc/Doclet.java
38890 views
/*1* Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package com.sun.javadoc;2627/**28* This is an example of a starting class for a doclet,29* showing the entry-point methods. A starting class must30* import com.sun.javadoc.* and implement the31* <code>start(RootDoc)</code> method, as described in the32* <a href="package-summary.html#package_description">package33* description</a>. If the doclet takes command line options,34* it must also implement <code>optionLength</code> and35* <code>validOptions</code>.36*37* <p> A doclet supporting the language features added since 1.138* (such as generics and annotations) should indicate this39* by implementing <code>languageVersion</code>. In the absence of40* this the doclet should not invoke any of the Doclet API methods41* added since 1.5, and42* the results of several other methods are modified so as43* to conceal the new constructs (such as type parameters) from44* the doclet.45*46* <p> To start the doclet, pass47* <code>-doclet</code> followed by the fully-qualified48* name of the starting class on the javadoc tool command line.49*/50public abstract class Doclet {5152/**53* Generate documentation here.54* This method is required for all doclets.55*56* @return true on success.57*/58public static boolean start(RootDoc root) {59return true;60}6162/**63* Check for doclet-added options. Returns the number of64* arguments you must specify on the command line for the65* given option. For example, "-d docs" would return 2.66* <P>67* This method is required if the doclet contains any options.68* If this method is missing, Javadoc will print an invalid flag69* error for every option.70*71* @return number of arguments on the command line for an option72* including the option name itself. Zero return means73* option not known. Negative value means error occurred.74*/75public static int optionLength(String option) {76return 0; // default is option unknown77}7879/**80* Check that options have the correct arguments.81* <P>82* This method is not required, but is recommended,83* as every option will be considered valid if this method84* is not present. It will default gracefully (to true)85* if absent.86* <P>87* Printing option related error messages (using the provided88* DocErrorReporter) is the responsibility of this method.89*90* @return true if the options are valid.91*/92public static boolean validOptions(String options[][],93DocErrorReporter reporter) {94return true; // default is options are valid95}9697/**98* Return the version of the Java Programming Language supported99* by this doclet.100* <p>101* This method is required by any doclet supporting a language version102* newer than 1.1.103*104* @return the language version supported by this doclet.105* @since 1.5106*/107public static LanguageVersion languageVersion() {108return LanguageVersion.JAVA_1_1;109}110}111112113