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

Wed, 01 Oct 2008 16:26:33 -0700

author
jjg
date
Wed, 01 Oct 2008 16:26:33 -0700
changeset 127
d593587c5938
parent 1
9a66ca7c79fa
child 129
944790f83b57
permissions
-rw-r--r--

6748601: javadoc API should allow varargs use
Reviewed-by: bpatel

     1 /*
     2  * Copyright 2000-2006 Sun Microsystems, Inc.  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.  Sun designates this
     8  * particular file as subject to the "Classpath" exception as provided
     9  * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    22  * CA 95054 USA or visit www.sun.com if you need additional information or
    23  * have any questions.
    24  */
    26 package com.sun.tools.javadoc;
    28 import java.io.PrintWriter;
    30 /**
    31  * Provides external entry points (tool and programmatic)
    32  * for the javadoc program.
    33  *
    34  * @since 1.4
    35  */
    36 public class Main {
    38     /**
    39      * Constructor should never be called.
    40      */
    41     private Main() {
    42     }
    44     /**
    45      * Command line interface.
    46      * @param args   The command line parameters.
    47      */
    48     public static void main(String... args) {
    49         System.exit(execute(args));
    50     }
    52     /**
    53      * Programmatic interface.
    54      * @param args   The command line parameters.
    55      * @return The return code.
    56      */
    57     public static int execute(String... args) {
    58         Start jdoc = new Start();
    59         return jdoc.begin(args);
    60     }
    62     /**
    63      * Programmatic interface.
    64      * @param programName  Name of the program (for error messages).
    65      * @param args   The command line parameters.
    66      * @return The return code.
    67      */
    68     public static int execute(String programName, String... args) {
    69         Start jdoc = new Start(programName);
    70         return jdoc.begin(args);
    71     }
    73     /**
    74      * Programmatic interface.
    75      * @param programName  Name of the program (for error messages).
    76      * @param defaultDocletClassName  Fully qualified class name.
    77      * @param args   The command line parameters.
    78      * @return The return code.
    79      */
    80     public static int execute(String programName,
    81                               String defaultDocletClassName,
    82                               String... args) {
    83         Start jdoc = new Start(programName, defaultDocletClassName);
    84         return jdoc.begin(args);
    85     }
    87     /**
    88      * Programmatic interface.
    89      * @param programName  Name of the program (for error messages).
    90      * @param errWriter    PrintWriter to receive error messages.
    91      * @param warnWriter    PrintWriter to receive error messages.
    92      * @param noticeWriter    PrintWriter to receive error messages.
    93      * @param defaultDocletClassName  Fully qualified class name.
    94      * @param args   The command line parameters.
    95      * @return The return code.
    96      */
    97     public static int execute(String programName,
    98                               PrintWriter errWriter,
    99                               PrintWriter warnWriter,
   100                               PrintWriter noticeWriter,
   101                               String defaultDocletClassName,
   102                               String... args) {
   103         Start jdoc = new Start(programName,
   104                                errWriter, warnWriter, noticeWriter,
   105                                defaultDocletClassName);
   106         return jdoc.begin(args);
   107     }
   108 }

mercurial