APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.javadoc.internal.tool

public Class JavadocTool

extends JavaCompiler
Class Inheritance
Imports
java.nio.file.Files, .InvalidPathException, .Paths, java.util.ArrayList, .HashSet, .LinkedHashSet, .List, .Set, javax.lang.model.element.Element, .ElementKind, javax.tools.JavaFileObject, .StandardJavaFileManager, com.sun.tools.javac.code.ClassFinder, .DeferredCompletionFailureHandler, .Symbol.Completer, .Symbol.CompletionFailure, .Symbol.PackageSymbol, com.sun.tools.javac.comp.Enter, com.sun.tools.javac.tree.JCTree, .JCTree.JCClassDecl, .JCTree.JCCompilationUnit, com.sun.tools.javac.util.Abort, .Context, .ListBuffer, .Position, jdk.javadoc.doclet.DocletEnvironment

This class could be the main entry point for Javadoc when Javadoc is used as a component in a larger software system. It provides operations to construct a new javadoc processor, and to run it on a set of source files.

Field Summary

Modifier and TypeField and Description
pack-priv final DeferredCompletionFailureHandler
pack-priv final Enter
pack-priv final ClassFinder
pack-priv final JavadocLog
pack-priv static final boolean
surrogatesSupported

Are surrogates supported?

pack-priv ToolEnvironment
pack-priv final Set<JavaFileObject>
Inherited from com.sun.tools.javac.main.JavaCompiler:
analyzerannotateannotationProcessingOccurredattrchkcloseablescompilePolicycompilerKeycompileStatescompletionFailureNamecontextdevVerbosediagselapsed_msecenterexplicitAnnotationProcessingRequestedfileManagerfinderflowgenimplicitSourceFilesReadimplicitSourcePolicyinputFilesjniWriterkeepCommentslineDebugInfolintMapperlowermakemoduleFindermodulesnamesoptionsparserFactoryprocessPcksreadershouldStopPolicyIfErrorshouldStopPolicyIfNoErrorsourcesourceCompletersourceOutputsymstaskListenertodotransTypestypesverboseverboseCompilePolicywarningAnalyzerwerrorLintwerrorNonLintwriter

Constructor Summary

AccessConstructor and Description
protected
JavadocTool(Context context)

Construct a new JavaCompiler processor, using appropriately extended phases of the underlying compiler.

Method Summary

Modifier and TypeMethod and Description
public DocletEnvironment
getEnvironment(ToolOptions toolOptions, List<String> javaNames, Iterable<? extends JavaFileObject> fileObjects)

private boolean
public static boolean

Returns:

true if given class name is a valid class name and false otherwise.
isValidClassName
(String
the name of the class to check.
s
)

Return true if given file name is a valid class name (including "package-info").

pack-priv boolean
isValidPackageName(String s)

Is the given string a valid package name?

private boolean
protected boolean
keepComments()

Overrides com.sun.tools.javac.main.JavaCompiler.keepComments.

For javadoc, the parser needs to keep comments.

pack-priv List<JCTree.JCClassDecl>
listClasses(List<JCTree.JCCompilationUnit> trees)

From a list of top level trees, return the list of contained class definitions

public static JavadocTool
make0(Context context)

Construct a new javadoc tool.

private void
parse(Iterable<? extends JavaFileObject> files, ListBuffer<JCTree.JCCompilationUnit> trees, boolean trace)

private static boolean
Inherited from com.sun.tools.javac.main.JavaCompiler:
attributeattributecheckReusableclosecompilecompilecontinueAfterProcessAnnotationsdesugardesugarenterDoneenterTreeserrorCountflowflowflowfullVersiongenerategenerateinitModulesinitProcessAnnotationsinstanceisEnterDoneisWerrornewRoundparseparseparseparseFilesparseFilesprintCountprintNoteprocessAnnotationsprocessAnnotationsreadSourcereadSourceFilereportDeferredDiagnosticAndClearHandlerreportDeferredDiagnosticsresolveBinaryNameOrIdentresolveBinaryNameOrIdentresolveIdentsetDeferredDiagnosticHandlershouldStopstopIfErrorstopIfErrorversionwarnwarnwarnwarningCount

Field Detail

dcfhback to summary
pack-priv final DeferredCompletionFailureHandler dcfh

Hides com.sun.tools.javac.main.JavaCompiler.dcfh.

javadocEnterback to summary
pack-priv final Enter javadocEnter
javadocFinderback to summary
pack-priv final ClassFinder javadocFinder
logback to summary
pack-priv final JavadocLog log

Hides com.sun.tools.javac.main.JavaCompiler.log.

surrogatesSupportedback to summary
pack-priv static final boolean surrogatesSupported

Are surrogates supported?

toolEnvback to summary
pack-priv ToolEnvironment toolEnv
uniquefilesback to summary
pack-priv final Set<JavaFileObject> uniquefiles

Constructor Detail

JavadocToolback to summary
protected JavadocTool(Context context)

Construct a new JavaCompiler processor, using appropriately extended phases of the underlying compiler.

Method Detail

getEnvironmentback to summary
public DocletEnvironment getEnvironment(ToolOptions toolOptions, List<String> javaNames, Iterable<? extends JavaFileObject> fileObjects) throws ToolException
isRegularFileback to summary
private boolean isRegularFile(String s)
isValidClassNameback to summary
public static boolean isValidClassName(String s)

Return true if given file name is a valid class name (including "package-info").

Parameters
s:String

the name of the class to check.

Returns:boolean

true if given class name is a valid class name and false otherwise.

isValidPackageNameback to summary
pack-priv boolean isValidPackageName(String s)

Is the given string a valid package name?

isValidPackageName0back to summary
private boolean isValidPackageName0(String s)
keepCommentsback to summary
protected boolean keepComments()

Overrides com.sun.tools.javac.main.JavaCompiler.keepComments.

For javadoc, the parser needs to keep comments. Overrides method from JavaCompiler.

Annotations
@Override
listClassesback to summary
pack-priv List<JCTree.JCClassDecl> listClasses(List<JCTree.JCCompilationUnit> trees)

From a list of top level trees, return the list of contained class definitions

make0back to summary
public static JavadocTool make0(Context context)

Construct a new javadoc tool.

parseback to summary
private void parse(Iterable<? extends JavaFileObject> files, ListBuffer<JCTree.JCCompilationUnit> trees, boolean trace)
surrogatesSupportedback to summary
private static boolean surrogatesSupported()