/* * @(#)ConfigurationStandard.java 1.5 98/04/17 * * Copyright 1998 by Sun Microsystems, Inc., * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. * All rights reserved. * * This software is the confidential and proprietary information * of Sun Microsystems, Inc. ("Confidential Information"). You * shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement * you entered into with Sun. */ package com.sun.tools.doclets.standard; import com.sun.tools.doclets.*; import com.sun.javadoc.*; import java.util.*; import java.io.*; /** * Configure the output based on the options. * * @author Robert Field. * @author Atul Dambalkar. */ public class ConfigurationStandard extends Configuration { public String releasename = ""; public String footer = ""; public String header = ""; public String title = ""; public String bottom = ""; public String helpfile = ""; public String stylesheetfile = ""; public boolean nohelp = false; public boolean createindex = true; public boolean splitindex = false; public boolean createtree = true; public boolean nodeprecatedlist = false; public boolean jdk = false; public boolean nonavbar = false; public static MessageRetriever standardmessage = null; public ConfigurationStandard() { if (standardmessage == null) { standardmessage = new MessageRetriever("com.sun.tools.javadoc.resources.standard"); } } public void setSpecificDocletOptions(RootDoc root) { String[][] options = root.options(); for (int oi = 0; oi < options.length; ++oi) { String[] os = options[oi]; String opt = os[0].toLowerCase(); if (opt.equals("-footer")) { footer = os[1]; } else if (opt.equals("-header")) { header = os[1]; } else if (opt.equals("-title")) { title = os[1]; } else if (opt.equals("-bottom")) { bottom = os[1]; } else if (opt.equals("-helpfile")) { helpfile = os[1]; } else if (opt.equals("-stylesheetfile")) { stylesheetfile = os[1]; } else if (opt.equals("-nohelp")) { nohelp = true; } else if (opt.equals("-splitindex")) { splitindex = true; } else if (opt.equals("-noindex")) { createindex = false; } else if (opt.equals("-notree")) { createtree = false; } else if (opt.equals("-nodeprecatedlist")) { nodeprecatedlist = true; } else if (opt.equals("-nonavbar")) { nonavbar = true; } else if (opt.equals("-xrelease")) { releasename = os[1]; } else if (opt.equals("-xjdk")) { jdk = true; } } } /** * Check for doclet added options here. * * @return number of arguments to option. Zero return means * option not known. Negative value means error occurred. */ public int specificDocletOptionLength(String option) { if (option.equals("-nodeprecatedlist") || option.equals("-noindex") || option.equals("-notree") || option.equals("-nohelp") || option.equals("-splitindex") || option.equals("-nonavbar") || option.equals("-xjdk")) { return 1; } else if (option.equals("-help") ) { standardmessage.notice("doclet.usage"); return 1; } else if (option.equals("-x") ) { standardmessage.notice("doclet.xusage"); return -1; // so run will end } else if (option.equals("-footer") || option.equals("-header") || option.equals("-title") || option.equals("-bottom") || option.equals("-helpfile") || option.equals("-stylesheetfile") || option.equals("-xrelease")) { return 2; } else { return 0; } } }