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

Tue, 24 Dec 2013 09:17:37 -0800

author
ksrini
date
Tue, 24 Dec 2013 09:17:37 -0800
changeset 2227
998b10c43157
parent 1359
25e14ad23cef
child 2525
2eb010b6cb22
permissions
-rw-r--r--

8029230: Update copyright year to match last edit in jdk8 langtools repository for 2013
Reviewed-by: ksrini
Contributed-by: steve.sides@oracle.com

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

mercurial