langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java
changeset 9608 385a828ba236
parent 5520 86e4b9a9da40
child 13842 6908f6badce4
equal deleted inserted replaced
9607:94b7adcaccad 9608:385a828ba236
     1 /*
     1 /*
     2  * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    29 import com.sun.tools.doclets.internal.toolkit.util.*;
    29 import com.sun.tools.doclets.internal.toolkit.util.*;
    30 
    30 
    31 import com.sun.javadoc.*;
    31 import com.sun.javadoc.*;
    32 import java.util.*;
    32 import java.util.*;
    33 import java.io.*;
    33 import java.io.*;
       
    34 import java.net.*;
    34 
    35 
    35 /**
    36 /**
    36  * Configure the output based on the command line options.
    37  * Configure the output based on the command line options.
    37  * <p>
    38  * <p>
    38  * Also determine the length of the command line option. For example,
    39  * Also determine the length of the command line option. For example,
    46  * </p>
    47  * </p>
    47  *
    48  *
    48  * @author Robert Field.
    49  * @author Robert Field.
    49  * @author Atul Dambalkar.
    50  * @author Atul Dambalkar.
    50  * @author Jamie Ho
    51  * @author Jamie Ho
       
    52  * @author Bhavesh Patel (Modified)
    51  */
    53  */
    52 public class ConfigurationImpl extends Configuration {
    54 public class ConfigurationImpl extends Configuration {
    53 
    55 
    54     private static ConfigurationImpl instance = new ConfigurationImpl();
    56     private static ConfigurationImpl instance = new ConfigurationImpl();
    55 
    57 
   106 
   108 
   107     /**
   109     /**
   108      * Argument for command line option "-stylesheetfile".
   110      * Argument for command line option "-stylesheetfile".
   109      */
   111      */
   110     public String stylesheetfile = "";
   112     public String stylesheetfile = "";
       
   113 
       
   114     /**
       
   115      * Argument for command line option "-Xdocrootparent".
       
   116      */
       
   117     public String docrootparent = "";
   111 
   118 
   112     /**
   119     /**
   113      * True if command line option "-nohelp" is used. Default value is false.
   120      * True if command line option "-nohelp" is used. Default value is false.
   114      */
   121      */
   115     public boolean nohelp = false;
   122     public boolean nohelp = false;
   237                 helpfile =  os[1];
   244                 helpfile =  os[1];
   238             } else  if (opt.equals("-stylesheetfile")) {
   245             } else  if (opt.equals("-stylesheetfile")) {
   239                 stylesheetfile =  os[1];
   246                 stylesheetfile =  os[1];
   240             } else  if (opt.equals("-charset")) {
   247             } else  if (opt.equals("-charset")) {
   241                 charset =  os[1];
   248                 charset =  os[1];
       
   249             } else if (opt.equals("-xdocrootparent")) {
       
   250                 docrootparent = os[1];
   242             } else  if (opt.equals("-nohelp")) {
   251             } else  if (opt.equals("-nohelp")) {
   243                 nohelp = true;
   252                 nohelp = true;
   244             } else  if (opt.equals("-splitindex")) {
   253             } else  if (opt.equals("-splitindex")) {
   245                 splitindex = true;
   254                 splitindex = true;
   246             } else  if (opt.equals("-noindex")) {
   255             } else  if (opt.equals("-noindex")) {
   320                    option.equals("-top") ||
   329                    option.equals("-top") ||
   321                    option.equals("-bottom") ||
   330                    option.equals("-bottom") ||
   322                    option.equals("-helpfile") ||
   331                    option.equals("-helpfile") ||
   323                    option.equals("-stylesheetfile") ||
   332                    option.equals("-stylesheetfile") ||
   324                    option.equals("-charset") ||
   333                    option.equals("-charset") ||
   325                    option.equals("-overview")) {
   334                    option.equals("-overview") ||
       
   335                    option.equals("-xdocrootparent")) {
   326             return 2;
   336             return 2;
   327         } else {
   337         } else {
   328             return 0;
   338             return 0;
   329         }
   339         }
   330     }
   340     }
   370                     reporter.printError(getText("doclet.Option_conflict",
   380                     reporter.printError(getText("doclet.Option_conflict",
   371                         "-nohelp", "-helpfile"));
   381                         "-nohelp", "-helpfile"));
   372                     return false;
   382                     return false;
   373                 }
   383                 }
   374                 nohelp = true;
   384                 nohelp = true;
       
   385             } else if (opt.equals("-xdocrootparent")) {
       
   386                 try {
       
   387                     new URL(os[1]);
       
   388                 } catch (MalformedURLException e) {
       
   389                     reporter.printError(getText("doclet.MalformedURL", os[1]));
       
   390                     return false;
       
   391                 }
   375             } else if (opt.equals("-overview")) {
   392             } else if (opt.equals("-overview")) {
   376                 if (nooverview == true) {
   393                 if (nooverview == true) {
   377                     reporter.printError(getText("doclet.Option_conflict",
   394                     reporter.printError(getText("doclet.Option_conflict",
   378                         "-overview", "-nooverview"));
   395                         "-overview", "-nooverview"));
   379                     return false;
   396                     return false;