001: /*
002: * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025:
026: package com.sun.tools.javadoc;
027:
028: import java.io.PrintWriter;
029:
030: /**
031: * Provides external entry points (tool and programmatic)
032: * for the javadoc program.
033: *
034: * @since 1.4
035: */
036: public class Main {
037:
038: /**
039: * Constructor should never be called.
040: */
041: private Main() {
042: }
043:
044: /**
045: * Command line interface.
046: * @param args The command line parameters.
047: */
048: public static void main(String[] args) {
049: System.exit(execute(args));
050: }
051:
052: /**
053: * Programmatic interface.
054: * @param args The command line parameters.
055: * @return The return code.
056: */
057: public static int execute(String[] args) {
058: Start jdoc = new Start();
059: return jdoc.begin(args);
060: }
061:
062: /**
063: * Programmatic interface.
064: * @param programName Name of the program (for error messages).
065: * @param args The command line parameters.
066: * @return The return code.
067: */
068: public static int execute(String programName, String[] args) {
069: Start jdoc = new Start(programName);
070: return jdoc.begin(args);
071: }
072:
073: /**
074: * Programmatic interface.
075: * @param programName Name of the program (for error messages).
076: * @param defaultDocletClassName Fully qualified class name.
077: * @param args The command line parameters.
078: * @return The return code.
079: */
080: public static int execute(String programName,
081: String defaultDocletClassName, String[] args) {
082: Start jdoc = new Start(programName, defaultDocletClassName);
083: return jdoc.begin(args);
084: }
085:
086: /**
087: * Programmatic interface.
088: * @param programName Name of the program (for error messages).
089: * @param errWriter PrintWriter to receive error messages.
090: * @param warnWriter PrintWriter to receive error messages.
091: * @param noticeWriter PrintWriter to receive error messages.
092: * @param defaultDocletClassName Fully qualified class name.
093: * @param args The command line parameters.
094: * @return The return code.
095: */
096: public static int execute(String programName,
097: PrintWriter errWriter, PrintWriter warnWriter,
098: PrintWriter noticeWriter, String defaultDocletClassName,
099: String[] args) {
100: Start jdoc = new Start(programName, errWriter, warnWriter,
101: noticeWriter, defaultDocletClassName);
102: return jdoc.begin(args);
103: }
104: }
|