Path: blob/aarch64-shenandoah-jdk8u272-b10/langtools/src/share/classes/com/sun/tools/javadoc/Main.java
38899 views
/*1* Copyright (c) 2000, 2012, 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.tools.javadoc;2627import java.io.PrintWriter;2829/**30* Provides external entry points (tool and programmatic)31* for the javadoc program.32*33* <p><b>This is NOT part of any supported API.34* If you write code that depends on this, you do so at your own risk.35* This code and its internal interfaces are subject to change or36* deletion without notice.</b>37*38* @since 1.439*/40public class Main {4142/**43* Constructor should never be called.44*/45private Main() {46}4748/**49* Command line interface.50* @param args The command line parameters.51*/52public static void main(String... args) {53System.exit(execute(args));54}5556/**57* Programmatic interface.58* @param args The command line parameters.59* @return The return code.60*/61public static int execute(String... args) {62Start jdoc = new Start();63return jdoc.begin(args);64}6566/**67* Programmatic interface.68* @param args The command line parameters.69* @param docletParentClassLoader The parent class loader used when70* creating the doclet classloader. If null, the class loader used71* to instantiate doclets will be created without specifying a parent72* class loader.73* @return The return code.74* @since 1.775*/76public static int execute(ClassLoader docletParentClassLoader, String... args) {77Start jdoc = new Start(docletParentClassLoader);78return jdoc.begin(args);79}8081/**82* Programmatic interface.83* @param programName Name of the program (for error messages).84* @param args The command line parameters.85* @return The return code.86*/87public static int execute(String programName, String... args) {88Start jdoc = new Start(programName);89return jdoc.begin(args);90}9192/**93* Programmatic interface.94* @param programName Name of the program (for error messages).95* @param args The command line parameters.96* @param docletParentClassLoader The parent class loader used when97* creating the doclet classloader. If null, the class loader used98* to instantiate doclets will be created without specifying a parent99* class loader.100* @return The return code.101* @since 1.7102*/103public static int execute(String programName, ClassLoader docletParentClassLoader, String... args) {104Start jdoc = new Start(programName, docletParentClassLoader);105return jdoc.begin(args);106}107108/**109* Programmatic interface.110* @param programName Name of the program (for error messages).111* @param defaultDocletClassName Fully qualified class name.112* @param args The command line parameters.113* @return The return code.114*/115public static int execute(String programName,116String defaultDocletClassName,117String... args) {118Start jdoc = new Start(programName, defaultDocletClassName);119return jdoc.begin(args);120}121122/**123* Programmatic interface.124* @param programName Name of the program (for error messages).125* @param defaultDocletClassName Fully qualified class name.126* @param docletParentClassLoader The parent class loader used when127* creating the doclet classloader. If null, the class loader used128* to instantiate doclets will be created without specifying a parent129* class loader.130* @param args The command line parameters.131* @return The return code.132* @since 1.7133*/134public static int execute(String programName,135String defaultDocletClassName,136ClassLoader docletParentClassLoader,137String... args) {138Start jdoc = new Start(programName, defaultDocletClassName, docletParentClassLoader);139return jdoc.begin(args);140}141142/**143* Programmatic interface.144* @param programName Name of the program (for error messages).145* @param errWriter PrintWriter to receive error messages.146* @param warnWriter PrintWriter to receive error messages.147* @param noticeWriter PrintWriter to receive error messages.148* @param defaultDocletClassName Fully qualified class name.149* @param args The command line parameters.150* @return The return code.151*/152public static int execute(String programName,153PrintWriter errWriter,154PrintWriter warnWriter,155PrintWriter noticeWriter,156String defaultDocletClassName,157String... args) {158Start jdoc = new Start(programName,159errWriter, warnWriter, noticeWriter,160defaultDocletClassName);161return jdoc.begin(args);162}163164/**165* Programmatic interface.166* @param programName Name of the program (for error messages).167* @param errWriter PrintWriter to receive error messages.168* @param warnWriter PrintWriter to receive error messages.169* @param noticeWriter PrintWriter to receive error messages.170* @param defaultDocletClassName Fully qualified class name.171* @param docletParentClassLoader The parent class loader used when172* creating the doclet classloader. If null, the class loader used173* to instantiate doclets will be created without specifying a parent174* class loader.175* @param args The command line parameters.176* @return The return code.177* @since 1.7178*/179public static int execute(String programName,180PrintWriter errWriter,181PrintWriter warnWriter,182PrintWriter noticeWriter,183String defaultDocletClassName,184ClassLoader docletParentClassLoader,185String... args) {186Start jdoc = new Start(programName,187errWriter, warnWriter, noticeWriter,188defaultDocletClassName,189docletParentClassLoader);190return jdoc.begin(args);191}192}193194195