src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AbstractDoclet.java
changeset 49879 601277b1d582
parent 48295 c79d31ba84b9
equal deleted inserted replaced
49878:2422d4e027b0 49879:601277b1d582
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2018, 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
    79     private static final String TOOLKIT_DOCLET_NAME =
    79     private static final String TOOLKIT_DOCLET_NAME =
    80         jdk.javadoc.internal.doclets.formats.html.HtmlDoclet.class.getName();
    80         jdk.javadoc.internal.doclets.formats.html.HtmlDoclet.class.getName();
    81 
    81 
    82     /**
    82     /**
    83      * Verify that the only doclet that is using this toolkit is
    83      * Verify that the only doclet that is using this toolkit is
    84      * {@value #TOOLKIT_DOCLET_NAME}.
    84      * #TOOLKIT_DOCLET_NAME.
    85      */
    85      */
    86     private boolean isValidDoclet() {
    86     private boolean isValidDoclet() {
    87         if (!getClass().getName().equals(TOOLKIT_DOCLET_NAME)) {
    87         if (!getClass().getName().equals(TOOLKIT_DOCLET_NAME)) {
    88             messages.error("doclet.Toolkit_Usage_Violation",
    88             messages.error("doclet.Toolkit_Usage_Violation",
    89                 TOOLKIT_DOCLET_NAME);
    89                 TOOLKIT_DOCLET_NAME);
   100      */
   100      */
   101     @Override
   101     @Override
   102     public boolean run(DocletEnvironment docEnv) {
   102     public boolean run(DocletEnvironment docEnv) {
   103         configuration = getConfiguration();
   103         configuration = getConfiguration();
   104         configuration.initConfiguration(docEnv);
   104         configuration.initConfiguration(docEnv);
   105         configuration.cmtUtils = new CommentUtils(configuration);
       
   106         configuration.utils = new Utils(configuration);
       
   107         utils = configuration.utils;
   105         utils = configuration.utils;
   108         configuration.workArounds = new WorkArounds(configuration);
       
   109         messages = configuration.getMessages();
   106         messages = configuration.getMessages();
   110 
   107 
   111         if (!isValidDoclet()) {
   108         if (!isValidDoclet()) {
   112             return false;
   109             return false;
   113         }
   110         }
   187      * Start the generation of files. Call generate methods in the individual
   184      * Start the generation of files. Call generate methods in the individual
   188      * writers, which will in turn generate the documentation files. Call the
   185      * writers, which will in turn generate the documentation files. Call the
   189      * TreeWriter generation first to ensure the Class Hierarchy is built
   186      * TreeWriter generation first to ensure the Class Hierarchy is built
   190      * first and then can be used in the later generation.
   187      * first and then can be used in the later generation.
   191      *
   188      *
   192      * @see jdk.doclet.DocletEnvironment
       
   193      * @throws DocletException if there is a problem while generating the documentation
   189      * @throws DocletException if there is a problem while generating the documentation
   194      */
   190      */
   195     private void startGeneration(DocletEnvironment docEnv) throws DocletException {
   191     private void startGeneration(DocletEnvironment docEnv) throws DocletException {
   196 
   192 
   197         // Modules with no documented classes may be specified on the
   193         // Modules with no documented classes may be specified on the