src/share/classes/com/sun/tools/javadoc/Main.java

Tue, 28 Dec 2010 15:54:52 -0800

author
ohair
date
Tue, 28 Dec 2010 15:54:52 -0800
changeset 798
4868a36f6fd8
parent 554
9d9f26857129
child 1359
25e14ad23cef
permissions
-rw-r--r--

6962318: Update copyright year
Reviewed-by: xdono

duke@1 1 /*
ohair@554 2 * Copyright (c) 2000, 2008, 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.tools.javadoc;
duke@1 27
duke@1 28 import java.io.PrintWriter;
duke@1 29
duke@1 30 /**
duke@1 31 * Provides external entry points (tool and programmatic)
duke@1 32 * for the javadoc program.
duke@1 33 *
duke@1 34 * @since 1.4
duke@1 35 */
duke@1 36 public class Main {
duke@1 37
duke@1 38 /**
duke@1 39 * Constructor should never be called.
duke@1 40 */
duke@1 41 private Main() {
duke@1 42 }
duke@1 43
duke@1 44 /**
duke@1 45 * Command line interface.
duke@1 46 * @param args The command line parameters.
duke@1 47 */
jjg@127 48 public static void main(String... args) {
duke@1 49 System.exit(execute(args));
duke@1 50 }
duke@1 51
duke@1 52 /**
duke@1 53 * Programmatic interface.
duke@1 54 * @param args The command line parameters.
duke@1 55 * @return The return code.
duke@1 56 */
jjg@127 57 public static int execute(String... args) {
duke@1 58 Start jdoc = new Start();
duke@1 59 return jdoc.begin(args);
duke@1 60 }
duke@1 61
duke@1 62 /**
duke@1 63 * Programmatic interface.
jjg@129 64 * @param args The command line parameters.
jjg@129 65 * @param docletParentClassLoader The parent class loader used when
jjg@129 66 * creating the doclet classloader. If null, the class loader used
jjg@129 67 * to instantiate doclets will be created without specifying a parent
jjg@129 68 * class loader.
jjg@129 69 * @return The return code.
jjg@129 70 * @since 1.7
jjg@129 71 */
jjg@129 72 public static int execute(ClassLoader docletParentClassLoader, String... args) {
jjg@129 73 Start jdoc = new Start(docletParentClassLoader);
jjg@129 74 return jdoc.begin(args);
jjg@129 75 }
jjg@129 76
jjg@129 77 /**
jjg@129 78 * Programmatic interface.
duke@1 79 * @param programName Name of the program (for error messages).
duke@1 80 * @param args The command line parameters.
duke@1 81 * @return The return code.
duke@1 82 */
jjg@127 83 public static int execute(String programName, String... args) {
duke@1 84 Start jdoc = new Start(programName);
duke@1 85 return jdoc.begin(args);
duke@1 86 }
duke@1 87
duke@1 88 /**
duke@1 89 * Programmatic interface.
duke@1 90 * @param programName Name of the program (for error messages).
jjg@129 91 * @param args The command line parameters.
jjg@129 92 * @param docletParentClassLoader The parent class loader used when
jjg@129 93 * creating the doclet classloader. If null, the class loader used
jjg@129 94 * to instantiate doclets will be created without specifying a parent
jjg@129 95 * class loader.
jjg@129 96 * @return The return code.
jjg@129 97 * @since 1.7
jjg@129 98 */
jjg@129 99 public static int execute(String programName, ClassLoader docletParentClassLoader, String... args) {
jjg@129 100 Start jdoc = new Start(programName, docletParentClassLoader);
jjg@129 101 return jdoc.begin(args);
jjg@129 102 }
jjg@129 103
jjg@129 104 /**
jjg@129 105 * Programmatic interface.
jjg@129 106 * @param programName Name of the program (for error messages).
duke@1 107 * @param defaultDocletClassName Fully qualified class name.
duke@1 108 * @param args The command line parameters.
duke@1 109 * @return The return code.
duke@1 110 */
duke@1 111 public static int execute(String programName,
duke@1 112 String defaultDocletClassName,
jjg@127 113 String... args) {
duke@1 114 Start jdoc = new Start(programName, defaultDocletClassName);
duke@1 115 return jdoc.begin(args);
duke@1 116 }
duke@1 117
duke@1 118 /**
duke@1 119 * Programmatic interface.
duke@1 120 * @param programName Name of the program (for error messages).
jjg@129 121 * @param defaultDocletClassName Fully qualified class name.
jjg@129 122 * @param docletParentClassLoader The parent class loader used when
jjg@129 123 * creating the doclet classloader. If null, the class loader used
jjg@129 124 * to instantiate doclets will be created without specifying a parent
jjg@129 125 * class loader.
jjg@129 126 * @param args The command line parameters.
jjg@129 127 * @return The return code.
jjg@129 128 * @since 1.7
jjg@129 129 */
jjg@129 130 public static int execute(String programName,
jjg@129 131 String defaultDocletClassName,
jjg@129 132 ClassLoader docletParentClassLoader,
jjg@129 133 String... args) {
jjg@129 134 Start jdoc = new Start(programName, defaultDocletClassName, docletParentClassLoader);
jjg@129 135 return jdoc.begin(args);
jjg@129 136 }
jjg@129 137
jjg@129 138 /**
jjg@129 139 * Programmatic interface.
jjg@129 140 * @param programName Name of the program (for error messages).
duke@1 141 * @param errWriter PrintWriter to receive error messages.
duke@1 142 * @param warnWriter PrintWriter to receive error messages.
duke@1 143 * @param noticeWriter PrintWriter to receive error messages.
duke@1 144 * @param defaultDocletClassName Fully qualified class name.
duke@1 145 * @param args The command line parameters.
duke@1 146 * @return The return code.
duke@1 147 */
duke@1 148 public static int execute(String programName,
duke@1 149 PrintWriter errWriter,
duke@1 150 PrintWriter warnWriter,
duke@1 151 PrintWriter noticeWriter,
duke@1 152 String defaultDocletClassName,
jjg@127 153 String... args) {
duke@1 154 Start jdoc = new Start(programName,
duke@1 155 errWriter, warnWriter, noticeWriter,
duke@1 156 defaultDocletClassName);
duke@1 157 return jdoc.begin(args);
duke@1 158 }
jjg@129 159
jjg@129 160 /**
jjg@129 161 * Programmatic interface.
jjg@129 162 * @param programName Name of the program (for error messages).
jjg@129 163 * @param errWriter PrintWriter to receive error messages.
jjg@129 164 * @param warnWriter PrintWriter to receive error messages.
jjg@129 165 * @param noticeWriter PrintWriter to receive error messages.
jjg@129 166 * @param defaultDocletClassName Fully qualified class name.
jjg@129 167 * @param docletParentClassLoader The parent class loader used when
jjg@129 168 * creating the doclet classloader. If null, the class loader used
jjg@129 169 * to instantiate doclets will be created without specifying a parent
jjg@129 170 * class loader.
jjg@129 171 * @param args The command line parameters.
jjg@129 172 * @return The return code.
jjg@129 173 * @since 1.7
jjg@129 174 */
jjg@129 175 public static int execute(String programName,
jjg@129 176 PrintWriter errWriter,
jjg@129 177 PrintWriter warnWriter,
jjg@129 178 PrintWriter noticeWriter,
jjg@129 179 String defaultDocletClassName,
jjg@129 180 ClassLoader docletParentClassLoader,
jjg@129 181 String... args) {
jjg@129 182 Start jdoc = new Start(programName,
jjg@129 183 errWriter, warnWriter, noticeWriter,
jjg@129 184 defaultDocletClassName,
jjg@129 185 docletParentClassLoader);
jjg@129 186 return jdoc.begin(args);
jjg@129 187 }
duke@1 188 }

mercurial