com.sun.tools.doclets.formats.html
Class ConfigurationImpl

java.lang.Object
  extended by com.sun.tools.doclets.internal.toolkit.Configuration
      extended by com.sun.tools.doclets.formats.html.ConfigurationImpl

public class ConfigurationImpl
extends Configuration

Configure the output based on the command line options.

Also determine the length of the command line option. For example, for a option "-header" there will be a string argument associated, then the the length of option "-header" is two. But for option "-nohelp" no argument is needed so it's length is 1.

Also do the error checking on the options used. For example it is illegal to use "-helpfile" option when already "-nohelp" option is used.


Field Summary
 java.lang.String bottom
          Argument for command line option "-bottom".
static java.lang.String BUILD_DATE
          The build date.
 boolean classuse
          True if command line option "-use" is used.
static java.lang.String CONSTANTS_FILE_NAME
          The name of the constant values file.
 boolean createindex
          False if command line option "-noindex" is used.
 boolean createoverview
          This is true if option "-overview" is used or option "-overview" is not used and number of packages is more than one.
 boolean createtree
          False if command line option "-notree" is used.
 ClassDoc currentcd
          The classdoc for the class file getting generated.
 java.lang.String doctitle
          Argument for command line option "-doctitle".
 java.lang.String footer
          Argument for command line option "-footer".
 java.lang.String header
          Argument for command line option "-header".
 java.lang.String helpfile
          Argument for command line option "-helpfile".
private static ConfigurationImpl instance
           
 boolean nodeprecatedlist
          True if command line option "-nodeprecated" is used.
 boolean nohelp
          True if command line option "-nohelp" is used.
 boolean nonavbar
          True if command line option "-nonavbar" is used.
private  boolean nooverview
          True if command line option "-nooverview" is used.
 boolean overview
          True if command line option "-overview" is used.
 java.lang.String packagesheader
          Argument for command line option "-packagesheader".
 boolean splitindex
          True if command line option "-splitindex" is used.
 MessageRetriever standardmessage
          Unique Resource Handler for this package.
 java.lang.String stylesheetfile
          Argument for command line option "-stylesheetfile".
 java.lang.String top
          Argument for command line option "-top".
 java.lang.String topFile
          First file to appear in the right-hand frame in the generated documentation.
 java.lang.String windowtitle
          Argument for command line option "-windowtitle".
 
Fields inherited from class com.sun.tools.doclets.internal.toolkit.Configuration
builderFactory, builderXMLPath, charset, classDocCatalog, copydocfilesubdirs, destDirName, docencoding, docFileDestDirName, encoding, excludedDocFileDirs, excludedQualifiers, extern, group, keywords, linksource, message, metakeywords, nocomment, nodeprecated, nosince, notimestamp, packages, root, serialwarn, showauthor, showversion, sourcepath, sourcetab, tagletManager, tagletpath
 
Constructor Summary
private ConfigurationImpl()
          Constructor.
 
Method Summary
protected  boolean checkForDeprecation(RootDoc root)
           
 java.lang.String getDocletSpecificBuildDate()
          Return the build date for the doclet.
 MessageRetriever getDocletSpecificMsg()
          Return the doclet specific MessageRetriever
static ConfigurationImpl getInstance()
           
 java.util.Locale getLocale()
          Return the Locale for this document.
 java.util.Comparator<ProgramElementDoc> getMemberComparator()
          Return the comparator that will be used to sort member documentation.
protected  ClassDoc getValidClass(ClassDoc[] classarr)
           
 WriterFactory getWriterFactory()
          Return the doclet specific instance of a writer factory.
 int optionLength(java.lang.String option)
          Returns the "length" of a given option.
static void reset()
          Reset to a fresh new ConfigurationImpl, to allow multiple invocations of javadoc within a single VM.
protected  void setCreateOverview()
          Generate "overview.html" page if option "-overview" is used or number of packages is more than one.
 void setSpecificDocletOptions(java.lang.String[][] options)
          Depending upon the command line options provided by the user, set configure the output generation environment.
protected  void setTopFile(RootDoc root)
          Decide the page which will appear first in the right-hand frame.
 boolean validOptions(java.lang.String[][] options, DocErrorReporter reporter)
          Perform error checking on the given options.
 
Methods inherited from class com.sun.tools.doclets.internal.toolkit.Configuration
generalValidOptions, getBuilderFactory, getBuilderXML, getClassName, getText, getText, getText, getText, isGeneratedDoc, setOptions, setOptions, shouldExcludeDocFileDir, shouldExcludeQualifier
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static ConfigurationImpl instance

BUILD_DATE

public static final java.lang.String BUILD_DATE
The build date. Note: For now, we will use a version number instead of a date.


CONSTANTS_FILE_NAME

public static final java.lang.String CONSTANTS_FILE_NAME
The name of the constant values file.

See Also:
Constant Field Values

header

public java.lang.String header
Argument for command line option "-header".


packagesheader

public java.lang.String packagesheader
Argument for command line option "-packagesheader".


footer

public java.lang.String footer
Argument for command line option "-footer".


doctitle

public java.lang.String doctitle
Argument for command line option "-doctitle".


windowtitle

public java.lang.String windowtitle
Argument for command line option "-windowtitle".


top

public java.lang.String top
Argument for command line option "-top".


bottom

public java.lang.String bottom
Argument for command line option "-bottom".


helpfile

public java.lang.String helpfile
Argument for command line option "-helpfile".


stylesheetfile

public java.lang.String stylesheetfile
Argument for command line option "-stylesheetfile".


nohelp

public boolean nohelp
True if command line option "-nohelp" is used. Default value is false.


splitindex

public boolean splitindex
True if command line option "-splitindex" is used. Default value is false.


createindex

public boolean createindex
False if command line option "-noindex" is used. Default value is true.


classuse

public boolean classuse
True if command line option "-use" is used. Default value is false.


createtree

public boolean createtree
False if command line option "-notree" is used. Default value is true.


nodeprecatedlist

public boolean nodeprecatedlist
True if command line option "-nodeprecated" is used. Default value is false.


nonavbar

public boolean nonavbar
True if command line option "-nonavbar" is used. Default value is false.


nooverview

private boolean nooverview
True if command line option "-nooverview" is used. Default value is false


overview

public boolean overview
True if command line option "-overview" is used. Default value is false.


createoverview

public boolean createoverview
This is true if option "-overview" is used or option "-overview" is not used and number of packages is more than one.


standardmessage

public final MessageRetriever standardmessage
Unique Resource Handler for this package.


topFile

public java.lang.String topFile
First file to appear in the right-hand frame in the generated documentation.


currentcd

public ClassDoc currentcd
The classdoc for the class file getting generated.

Constructor Detail

ConfigurationImpl

private ConfigurationImpl()
Constructor. Initialises resource for the com.sun.tools.doclets.MessageRetriever.

Method Detail

reset

public static void reset()
Reset to a fresh new ConfigurationImpl, to allow multiple invocations of javadoc within a single VM. It would be better not to be using static fields at all, but .... (sigh).


getInstance

public static ConfigurationImpl getInstance()

getDocletSpecificBuildDate

public java.lang.String getDocletSpecificBuildDate()
Return the build date for the doclet.

Specified by:
getDocletSpecificBuildDate in class Configuration

setSpecificDocletOptions

public void setSpecificDocletOptions(java.lang.String[][] options)
Depending upon the command line options provided by the user, set configure the output generation environment.

Specified by:
setSpecificDocletOptions in class Configuration
Parameters:
options - The array of option names and values.

optionLength

public int optionLength(java.lang.String option)
Returns the "length" of a given option. If an option takes no arguments, its length is one. If it takes one argument, it's length is two, and so on. This method is called by JavaDoc to parse the options it does not recognize. It then calls validOptions(String[][], DocErrorReporter) to validate them. Note:
The options arrive as case-sensitive strings. For options that are not case-sensitive, use toLowerCase() on the option string before comparing it.

Overrides:
optionLength in class Configuration
Parameters:
option - Command line option under consideration.
Returns:
number of arguments + 1 for a option. Zero return means option not known. Negative value means error occurred.

validOptions

public boolean validOptions(java.lang.String[][] options,
                            DocErrorReporter reporter)
Perform error checking on the given options.

Specified by:
validOptions in class Configuration
Parameters:
options - the given options to check.
reporter - the reporter used to report errors.

getDocletSpecificMsg

public MessageRetriever getDocletSpecificMsg()
Return the doclet specific MessageRetriever

Specified by:
getDocletSpecificMsg in class Configuration
Returns:
the doclet specific MessageRetriever.

setTopFile

protected void setTopFile(RootDoc root)
Decide the page which will appear first in the right-hand frame. It will be "overview-summary.html" if "-overview" option is used or no "-overview" but the number of packages is more than one. It will be "package-summary.html" of the respective package if there is only one package to document. It will be a class page(first in the sorted order), if only classes are provided on the command line.

Parameters:
root - Root of the program structure.

getValidClass

protected ClassDoc getValidClass(ClassDoc[] classarr)

checkForDeprecation

protected boolean checkForDeprecation(RootDoc root)

setCreateOverview

protected void setCreateOverview()
Generate "overview.html" page if option "-overview" is used or number of packages is more than one. Sets createoverview field to true.


getWriterFactory

public WriterFactory getWriterFactory()
Return the doclet specific instance of a writer factory.

Specified by:
getWriterFactory in class Configuration
Returns:
the WriterFactory for the doclet.

getMemberComparator

public java.util.Comparator<ProgramElementDoc> getMemberComparator()
Return the comparator that will be used to sort member documentation. To no do any sorting, return null.

Specified by:
getMemberComparator in class Configuration
Returns:
the Comparator used to sort members.

getLocale

public java.util.Locale getLocale()
Return the Locale for this document.

Specified by:
getLocale in class Configuration