Top Description Inners Fields Constructors Methods
jdk.javadoc.internal.tool

public Class ToolOptions

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Arrays, .LinkedHashMap, .List, .Map, javax.lang.model.element.ElementKind, com.sun.tools.javac.main.Option, .Option.InvalidValueException, .OptionHelper, com.sun.tools.javac.util.Context, .Options

Storage and support for javadoc tool options, as distinct from the options supported by any doclet that may be in use. The tool options includes those options which are delegated to javac and/or the file manager, such as options to set the source level, and path options to locate the files to be documented.

Some of the methods used to access the values of options have names that begin with a verb, such as expandRequires or ignoreSourceErrors. Unless otherwise stated, these methods should all be taken as just accessing the value of the associated option.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static interface
pack-priv static class
ToolOptions.ToolOption

Base class for all supported tool options.

Field Summary

Modifier and TypeField and Description
pack-priv static final String
private boolean
breakIterator

Argument for command-line option -breakiterator.

private final OptionHelper
compilerOptionHelper

The "helper" to be used when processing compiler options.

private final Options
compOpts

Options to be given to the underlying compiler front-end, such as options to indicate the source level to be used.

pack-priv static final String
pack-priv static final String
pack-priv static final String
private boolean
dumpOnError

Argument for command-line option --dump-on-error.

private List<String>
excludes

Argument for command-line option -exclude.

private AccessLevel
expandRequires

Argument for command-line option --expand-requires.

private final Map<Option, String>
fileManagerOpts

Options to be given to the file manager, such as path options indicating where to find files to be documented.

private boolean
ignoreSourceErrors

Argument for command-line option --ignore-source-errors.

pack-priv static final String
J

pack-priv static final String
private final JavadocLog
log

The log to be used to report diagnostics..

private List<String>
modules

Argument for command-line option --module.

private boolean
quiet

Argument for command-line option -quiet.

private boolean
rejectWarnings

Argument for command-line option -Werror.

private final ToolOptions.ShowHelper
showHelper

The helper for help and version options

private AccessLevel
showMembersAccess

Argument for command-line option --show-members.

private AccessLevel
showModuleContents

Argument for command-line option --show-module-contents.

private AccessLevel
showPackagesAccess

Argument for command-line option --show-packages.

private AccessLevel
showTypesAccess

Argument for command-line option --show-types.

private List<String>
subpackages

Argument for command-line option -subpackages.

private List<ToolOptions.ToolOption>
private boolean
verbose

Argument for command-line option -verbose.

private boolean
xclasses

Argument for command-line option -Xclasses.

Constructor Summary

AccessConstructor and Description
pack-priv
ToolOptions(Context
the context used to find other tool-related components
context
,
JavadocLog
the log to be used to report diagnostics
log
,
ToolOptions.ShowHelper showHelper)

Creates an object to handle tool options.

private
ToolOptions()

Creates a minimal object, just sufficient to check the names of the supported options.

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
breakIterator()

Argument for command-line option -breakiterator.

pack-priv Options

Returns:

the options
compilerOptions
()

Returns the set of options to be used for the instance of the underlying compiler front-end.

pack-priv boolean
dumpOnError()

Argument for command-line option --dump-on-error.

pack-priv List<String>
excludes()

Argument for command-line option -exclude.

pack-priv AccessLevel
expandRequires()

Argument for command-line option --expand-requires.

pack-priv Map<Option, String>

Returns:

the options
fileManagerOptions
()

Returns the set of options to be used for the file manager.

private AccessLevel
pack-priv ToolOptions.ToolOption

Returns:

the option
getOption
(String
the argument
arg
)

Returns the option to be used to process an argument such as may be found on the command line.

private OptionHelper

Returns:

the helper
getOptionHelper
()

Returns a "helper" to be used when processing compiler options.

public List<ToolOptions.ToolOption>

Returns:

the set of options
getSupportedOptions
()

Returns the set of options supported by the tool, excluding any options that are managed by the doclet that may be in use.

pack-priv boolean
ignoreSourceErrors()

Argument for command-line option --ignore-source-errors.

private IllegalOptionValue

Returns:

the exception
illegalOptionValue
(String
the argument to include in the detail message
arg
)

Returns an IllegalOptionValue exception.

public static int

Returns:

the number of arguments the given option takes or -1 if the option is not supported
isSupportedOption
(String
an option
option
)

Determines if the given option is supported and if so, the number of arguments the option takes.

pack-priv List<String>
modules()

Argument for command-line option --module.

pack-priv void
processCompilerOption(Option
the option object to process the command-line option
option
,
String
the command-line option
opt
)

Process a compiler option.

private void
processCompilerOption(Option
the option object to process the command-line option
option
,
String
the command-line option
opt
,
String
the argument for the command-line option
arg
)

Process a compiler option.

pack-priv boolean
quiet()

Argument for command-line option -quiet.

pack-priv boolean
rejectWarnings()

Argument for command-line option -Werror.

private void
setAccess(AccessLevel accessValue)

private void
pack-priv void
setDumpOnError(boolean v)

private void
private void
private void
private void
private void
private void
private void
private void
pack-priv AccessLevel
showMembersAccess()

Argument for command-line option --show-members.

pack-priv AccessLevel
showModuleContents()

Argument for command-line option --show-module-contents.

pack-priv AccessLevel
showPackagesAccess()

Argument for command-line option --show-packages.

pack-priv AccessLevel
showTypesAccess()

Argument for command-line option --show-types.

pack-priv List<String>
subpackages()

Argument for command-line option -subpackages.

pack-priv boolean
verbose()

Argument for command-line option -verbose.

pack-priv boolean
xclasses()

Argument for command-line option -Xclasses.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ATback to summary
pack-priv static final String AT
breakIteratorback to summary
private boolean breakIterator

Argument for command-line option -breakiterator.

compilerOptionHelperback to summary
private final OptionHelper compilerOptionHelper

The "helper" to be used when processing compiler options.

compOptsback to summary
private final Options compOpts

Options to be given to the underlying compiler front-end, such as options to indicate the source level to be used.

DOCLETback to summary
pack-priv static final String DOCLET
DOCLET_PATHback to summary
pack-priv static final String DOCLET_PATH
DUMP_ON_ERRORback to summary
pack-priv static final String DUMP_ON_ERROR
dumpOnErrorback to summary
private boolean dumpOnError

Argument for command-line option --dump-on-error. Dump stack traces for debugging etc. Similar to javac -doe.

excludesback to summary
private List<String> excludes

Argument for command-line option -exclude.

expandRequiresback to summary
private AccessLevel expandRequires

Argument for command-line option --expand-requires.

fileManagerOptsback to summary
private final Map<Option, String> fileManagerOpts

Options to be given to the file manager, such as path options indicating where to find files to be documented.

ignoreSourceErrorsback to summary
private boolean ignoreSourceErrors

Argument for command-line option --ignore-source-errors.

Jback to summary
pack-priv static final String J
LOCALEback to summary
pack-priv static final String LOCALE
logback to summary
private final JavadocLog log

The log to be used to report diagnostics..

modulesback to summary
private List<String> modules

Argument for command-line option --module.

quietback to summary
private boolean quiet

Argument for command-line option -quiet.

rejectWarningsback to summary
private boolean rejectWarnings

Argument for command-line option -Werror. Set by -Werror.

showHelperback to summary
private final ToolOptions.ShowHelper showHelper

The helper for help and version options

showMembersAccessback to summary
private AccessLevel showMembersAccess

Argument for command-line option --show-members.

showModuleContentsback to summary
private AccessLevel showModuleContents

Argument for command-line option --show-module-contents.

showPackagesAccessback to summary
private AccessLevel showPackagesAccess

Argument for command-line option --show-packages.

showTypesAccessback to summary
private AccessLevel showTypesAccess

Argument for command-line option --show-types.

subpackagesback to summary
private List<String> subpackages

Argument for command-line option -subpackages.

supportedOptionsback to summary
private List<ToolOptions.ToolOption> supportedOptions
verboseback to summary
private boolean verbose

Argument for command-line option -verbose.

xclassesback to summary
private boolean xclasses

Argument for command-line option -Xclasses. If true, names on the command line that would normally be treated as package names are treated as class names instead.

Constructor Detail

ToolOptionsback to summary
pack-priv ToolOptions(Context context, JavadocLog log, ToolOptions.ShowHelper showHelper)

Creates an object to handle tool options.

Parameters
context:Context

the context used to find other tool-related components

log:JavadocLog

the log to be used to report diagnostics

ToolOptionsback to summary
private ToolOptions()

Creates a minimal object, just sufficient to check the names of the supported options.

Method Detail

breakIteratorback to summary
pack-priv boolean breakIterator()

Argument for command-line option -breakiterator.

compilerOptionsback to summary
pack-priv Options compilerOptions()

Returns the set of options to be used for the instance of the underlying compiler front-end.

Returns:Options

the options

dumpOnErrorback to summary
pack-priv boolean dumpOnError()

Argument for command-line option --dump-on-error. Dump stack traces for debugging etc. Similar to javac -doe.

excludesback to summary
pack-priv List<String> excludes()

Argument for command-line option -exclude.

expandRequiresback to summary
pack-priv AccessLevel expandRequires()

Argument for command-line option --expand-requires.

fileManagerOptionsback to summary
pack-priv Map<Option, String> fileManagerOptions()

Returns the set of options to be used for the file manager.

Returns:Map<Option, String>

the options

getAccessValueback to summary
private AccessLevel getAccessValue(String arg) throws OptionException
getOptionback to summary
pack-priv ToolOptions.ToolOption getOption(String arg)

Returns the option to be used to process an argument such as may be found on the command line.

Parameters
arg:String

the argument

Returns:ToolOptions.ToolOption

the option

getOptionHelperback to summary
private OptionHelper getOptionHelper()

Returns a "helper" to be used when processing compiler options.

Returns:OptionHelper

the helper

getSupportedOptionsback to summary
public List<ToolOptions.ToolOption> getSupportedOptions()

Returns the set of options supported by the tool, excluding any options that are managed by the doclet that may be in use.

Returns:List<ToolOptions.ToolOption>

the set of options

ignoreSourceErrorsback to summary
pack-priv boolean ignoreSourceErrors()

Argument for command-line option --ignore-source-errors.

illegalOptionValueback to summary
private IllegalOptionValue illegalOptionValue(String arg)

Returns an IllegalOptionValue exception.

Parameters
arg:String

the argument to include in the detail message

Returns:IllegalOptionValue

the exception

isSupportedOptionback to summary
public static int isSupportedOption(String option)

Determines if the given option is supported and if so, the number of arguments the option takes.

Parameters
option:String

an option

Returns:int

the number of arguments the given option takes or -1 if the option is not supported

See Also
javax.tools.DocumentationTool#isSupportedOption(String)
modulesback to summary
pack-priv List<String> modules()

Argument for command-line option --module.

processCompilerOptionback to summary
pack-priv void processCompilerOption(Option option, String opt) throws InvalidValueException

Process a compiler option.

Parameters
option:Option

the option object to process the command-line option

opt:String

the command-line option

Exceptions
InvalidValueException:
if the command-line option is invalid
processCompilerOptionback to summary
private void processCompilerOption(Option option, String opt, String arg) throws InvalidValueException

Process a compiler option.

Parameters
option:Option

the option object to process the command-line option

opt:String

the command-line option

arg:String

the argument for the command-line option

Exceptions
InvalidValueException:
if the command-line option is invalid
quietback to summary
pack-priv boolean quiet()

Argument for command-line option -quiet.

rejectWarningsback to summary
pack-priv boolean rejectWarnings()

Argument for command-line option -Werror. Set by -Werror.

setAccessback to summary
private void setAccess(AccessLevel accessValue)
setAccessDefaultback to summary
private void setAccessDefault()
setDumpOnErrorback to summary
pack-priv void setDumpOnError(boolean v)
setExpandRequiresback to summary
private void setExpandRequires(String arg) throws OptionException
setShowMembersAccessback to summary
private void setShowMembersAccess(String arg) throws OptionException
setShowModuleContentsback to summary
private void setShowModuleContents(String arg) throws OptionException
setShowPackageAccessback to summary
private void setShowPackageAccess(String arg) throws OptionException
setShowTypesAccessback to summary
private void setShowTypesAccess(String arg) throws OptionException
setSimpleAccessOptionback to summary
private void setSimpleAccessOption(String arg) throws OptionException
setSimpleFilterback to summary
private void setSimpleFilter(String arg) throws OptionException
setVerboseback to summary
private void setVerbose()
showMembersAccessback to summary
pack-priv AccessLevel showMembersAccess()

Argument for command-line option --show-members.

showModuleContentsback to summary
pack-priv AccessLevel showModuleContents()

Argument for command-line option --show-module-contents.

showPackagesAccessback to summary
pack-priv AccessLevel showPackagesAccess()

Argument for command-line option --show-packages.

showTypesAccessback to summary
pack-priv AccessLevel showTypesAccess()

Argument for command-line option --show-types.

subpackagesback to summary
pack-priv List<String> subpackages()

Argument for command-line option -subpackages.

verboseback to summary
pack-priv boolean verbose()

Argument for command-line option -verbose.

xclassesback to summary
pack-priv boolean xclasses()

Argument for command-line option -Xclasses. If true, names on the command line that would normally be treated as package names are treated as class names instead.

jdk.javadoc.internal.tool back to summary

pack-priv Interface ToolOptions.ShowHelper


Method Summary

Modifier and TypeMethod and Description
public void
fullVersion()

Show the full version information, as requested by the --full-version option.

public void
usage()

Show command-line help for the standard options, as requested by the --help option and its aliases.

public void
version()

Show the basic version information, as requested by the --version option.

public void
Xusage()

Show command-line help for the extended options, as requested by the --help-extended option and its aliases.

Method Detail

fullVersionback to summary
public void fullVersion()

Show the full version information, as requested by the --full-version option.

usageback to summary
public void usage()

Show command-line help for the standard options, as requested by the --help option and its aliases.

versionback to summary
public void version()

Show the basic version information, as requested by the --version option.

Xusageback to summary
public void Xusage()

Show command-line help for the extended options, as requested by the --help-extended option and its aliases.

jdk.javadoc.internal.tool back to summary

pack-priv Class ToolOptions.ToolOption

extends Object
Class Inheritance

Base class for all supported tool options.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum

Field Summary

Modifier and TypeField and Description
pack-priv final boolean
pack-priv final boolean
pack-priv final ToolOptions.ToolOption.Kind
pack-priv final List<String>
pack-priv final String

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
ToolOption(String names, ToolOptions.ToolOption.Kind kind, boolean hasArg)

Method Summary

Modifier and TypeMethod and Description
pack-priv String
private String
getKey(String optionName, String suffix)

pack-priv List<String>
pack-priv String
pack-priv void
pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

hasArgback to summary
pack-priv final boolean hasArg
hasSuffixback to summary
pack-priv final boolean hasSuffix
kindback to summary
pack-priv final ToolOptions.ToolOption.Kind kind
namesback to summary
pack-priv final List<String> names
primaryNameback to summary
pack-priv final String primaryName

Constructor Detail

ToolOptionback to summary
pack-priv ToolOption(String opt, ToolOptions.ToolOption.Kind kind)
ToolOptionback to summary
pack-priv ToolOption(String names, ToolOptions.ToolOption.Kind kind, boolean hasArg)

Method Detail

getDescriptionback to summary
pack-priv String getDescription(JavadocLog log)
getKeyback to summary
private String getKey(String optionName, String suffix)
getNamesback to summary
pack-priv List<String> getNames()
getParametersback to summary
pack-priv String getParameters(JavadocLog log)
processback to summary
pack-priv void process(String arg) throws OptionException, InvalidValueException
processback to summary
pack-priv void process() throws OptionException, InvalidValueException
jdk.javadoc.internal.tool back to summary

pack-priv final Enum ToolOptions.ToolOption.Kind

extends Enum<ToolOptions.ToolOption.Kind>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final ToolOptions.ToolOption.Kind
public static final ToolOptions.ToolOption.Kind
public static final ToolOptions.ToolOption.Kind

Constructor Summary

AccessConstructor and Description
private
Kind()

Field Detail

EXTENDEDback to summary
public static final ToolOptions.ToolOption.Kind EXTENDED
HIDDENback to summary
public static final ToolOptions.ToolOption.Kind HIDDEN
STANDARDback to summary
public static final ToolOptions.ToolOption.Kind STANDARD

Constructor Detail

Kindback to summary
private Kind()

Method Detail

valueOfback to summary
public static ToolOptions.ToolOption.Kind valueOf(String name)
valuesback to summary
public static ToolOptions.ToolOption.Kind[] values()