src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeBuilder.java
author jjg
Wed, 21 Nov 2018 12:36:16 -0800
changeset 52644 43efb4ca6d6c
parent 48029 e9dab2492924
child 54060 53a95878619f
permissions -rw-r--r--
8214139: Remove wrapper methods from {Base,Html}Configuration Reviewed-by: pmuthuswamy, hannesw
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
52644
43efb4ca6d6c 8214139: Remove wrapper methods from {Base,Html}Configuration
jjg
parents: 48029
diff changeset
     2
 * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1789
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1789
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1789
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1789
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1789
diff changeset
    23
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    26
package jdk.javadoc.internal.doclets.toolkit.builders;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    28
import javax.lang.model.element.PackageElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    29
import javax.lang.model.element.TypeElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    30
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    31
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeWriter;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    32
import jdk.javadoc.internal.doclets.toolkit.Content;
48029
e9dab2492924 8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents: 47272
diff changeset
    33
import jdk.javadoc.internal.doclets.toolkit.DocFilesHandler;
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    34
import jdk.javadoc.internal.doclets.toolkit.DocletException;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    35
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 * Builds the summary for a given annotation type.
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 *
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    40
 *  <p><b>This is NOT part of any supported API.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    41
 *  If you write code that depends on this, you do so at your own risk.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    42
 *  This code and its internal interfaces are subject to change or
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    43
 *  deletion without notice.</b>
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
 * @author Jamie Ho
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    46
 * @author Bhavesh Patel (Modified)
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
public class AnnotationTypeBuilder extends AbstractBuilder {
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
     * The annotation type being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    53
    private final TypeElement annotationType;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
     * The doclet specific writer.
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
     */
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    58
    private final AnnotationTypeWriter writer;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    61
     * The content tree for the annotation documentation.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    62
     */
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    63
    private Content contentTree;
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    64
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
    65
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
     * Construct a new ClassBuilder.
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
     *
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    68
     * @param context           the build context.
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    69
     * @param annotationTypeElement the class being documented.
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    70
     * @param writer            the doclet specific writer.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
     */
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    72
    private AnnotationTypeBuilder(Context context,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    73
            TypeElement annotationTypeElement,
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    74
            AnnotationTypeWriter writer) {
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    75
        super(context);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    76
        this.annotationType = annotationTypeElement;
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    77
        this.writer = writer;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
    /**
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    81
     * Construct a new AnnotationTypeBuilder.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
     *
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    83
     * @param context           the build context.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
     * @param annotationTypeDoc the class being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
     * @param writer            the doclet specific writer.
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    86
     * @return                  an AnnotationTypeBuilder
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
     */
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    88
    public static AnnotationTypeBuilder getInstance(Context context,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
    89
            TypeElement annotationTypeDoc,
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    90
            AnnotationTypeWriter writer) {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14368
diff changeset
    91
        return new AnnotationTypeBuilder(context, annotationTypeDoc, writer);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    97
    @Override
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
    98
    public void build() throws DocletException {
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
    99
        buildAnnotationTypeDoc(contentTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   102
    /**
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   103
     * Build the annotation type documentation.
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   104
     *
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   105
     * @param contentTree the content tree to which the documentation will be added
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   106
     * @throws DocletException if there is a problem building the documentation
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   107
     */
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   108
    protected void buildAnnotationTypeDoc(Content contentTree) throws DocletException {
52644
43efb4ca6d6c 8214139: Remove wrapper methods from {Base,Html}Configuration
jjg
parents: 48029
diff changeset
   109
        contentTree = writer.getHeader(resources.getText("doclet.AnnotationType") +
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   110
               " " + utils.getSimpleName(annotationType));
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   111
        Content annotationContentTree = writer.getAnnotationContentHeader();
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   112
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   113
        buildAnnotationTypeInfo(annotationContentTree);
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   114
        buildMemberSummary(annotationContentTree);
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   115
        buildAnnotationTypeMemberDetails(annotationContentTree);
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   116
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   117
        writer.addAnnotationContentTree(contentTree, annotationContentTree);
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   118
        writer.addFooter(contentTree);
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   119
        writer.printDocument(contentTree);
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   120
        copyDocFiles();
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   121
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   123
    /**
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   124
     * Copy the doc files for the current TypeElement if necessary.
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   125
     *
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   126
     * @throws DocletException if there is a problem building the documentation
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   127
     */
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   128
    private void copyDocFiles() throws DocletException {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   129
        PackageElement containingPackage = utils.containingPackage(annotationType);
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   130
        if ((configuration.packages == null ||
24221
2376793dd33b 8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents: 20237
diff changeset
   131
            !configuration.packages.contains(containingPackage) &&
2376793dd33b 8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents: 20237
diff changeset
   132
            !containingPackagesSeen.contains(containingPackage))){
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
            //Only copy doc files dir if the containing package is not
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
            //documented AND if we have not documented a class from the same
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
            //package already. Otherwise, we are making duplicate copies.
48029
e9dab2492924 8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents: 47272
diff changeset
   136
            DocFilesHandler docFilesHandler = configuration
e9dab2492924 8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents: 47272
diff changeset
   137
                    .getWriterFactory()
e9dab2492924 8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents: 47272
diff changeset
   138
                    .getDocFilesHandler(containingPackage);
e9dab2492924 8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents: 47272
diff changeset
   139
            docFilesHandler.copyDocFiles();
24221
2376793dd33b 8038583: [javadoc] Refactor uses of arrays to Collections
ksrini
parents: 20237
diff changeset
   140
            containingPackagesSeen.add(containingPackage);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
        }
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   142
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   145
     * Build the annotation information tree documentation.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   146
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   147
     * @param annotationContentTree the content tree to which the documentation will be added
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   148
     * @throws DocletException if there is a problem building the documentation
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
     */
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   150
    protected void buildAnnotationTypeInfo(Content annotationContentTree)
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   151
            throws DocletException {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   152
        Content annotationInfoTree = writer.getAnnotationInfoTreeHeader();
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   153
47272
e0d686cdf608 8183511: improve style for deprecated text
bpatel
parents: 47216
diff changeset
   154
        buildAnnotationTypeSignature(annotationInfoTree);
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   155
        buildDeprecationInfo(annotationInfoTree);
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   156
        buildAnnotationTypeDescription(annotationInfoTree);
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   157
        buildAnnotationTypeTagInfo(annotationInfoTree);
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   158
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   159
        annotationContentTree.addContent(writer.getAnnotationInfo(annotationInfoTree));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   163
     * If this annotation is deprecated, build the appropriate information.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   164
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   165
     * @param annotationInfoTree the content tree to which the documentation will be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
     */
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   167
    protected void buildDeprecationInfo(Content annotationInfoTree) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   168
        writer.addAnnotationTypeDeprecationInfo(annotationInfoTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
     * Build the signature of the current annotation type.
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   173
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   174
     * @param annotationInfoTree the content tree to which the documentation will be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
     */
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   176
    protected void buildAnnotationTypeSignature(Content annotationInfoTree) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   177
        writer.addAnnotationTypeSignature(utils.modifiersToString(annotationType, true),
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 29957
diff changeset
   178
                annotationInfoTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   182
     * Build the annotation type description.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   183
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   184
     * @param annotationInfoTree the content tree to which the documentation will be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
     */
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   186
    protected void buildAnnotationTypeDescription(Content annotationInfoTree) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   187
        writer.addAnnotationTypeDescription(annotationInfoTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   191
     * Build the tag information for the current annotation type.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   192
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   193
     * @param annotationInfoTree the content tree to which the documentation will be added
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
     */
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   195
    protected void buildAnnotationTypeTagInfo(Content annotationInfoTree) {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   196
        writer.addAnnotationTypeTagInfo(annotationInfoTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
    /**
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   200
     * Build the member summary contents of the page.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
     *
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   202
     * @param annotationContentTree the content tree to which the documentation will be added
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   203
     * @throws DocletException if there is a problem building the documentation
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
     */
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   205
    protected void buildMemberSummary(Content annotationContentTree) throws DocletException {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   206
        Content memberSummaryTree = writer.getMemberTreeHeader();
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   207
        builderFactory.getMemberSummaryBuilder(writer).build(memberSummaryTree);
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   208
        annotationContentTree.addContent(writer.getMemberSummaryTree(memberSummaryTree));
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   209
    }
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   210
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   211
    /**
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   212
     * Build the member details contents of the page.
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   213
     *
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   214
     * @param annotationContentTree the content tree to which the documentation will be added
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   215
     * @throws DocletException if there is a problem building the documentation
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   216
     */
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   217
    protected void buildAnnotationTypeMemberDetails(Content annotationContentTree)
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   218
            throws DocletException {
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   219
        Content memberDetailsTree = writer.getMemberTreeHeader();
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   220
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   221
        buildAnnotationTypeFieldDetails(memberDetailsTree);
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   222
        buildAnnotationTypeRequiredMemberDetails(memberDetailsTree);
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   223
        buildAnnotationTypeOptionalMemberDetails(memberDetailsTree);
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   224
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   225
        if (memberDetailsTree.isValid()) {
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16560
diff changeset
   226
            annotationContentTree.addContent(writer.getMemberDetailsTree(memberDetailsTree));
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   227
        }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
    /**
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16560
diff changeset
   231
     * Build the annotation type field documentation.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16560
diff changeset
   232
     *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16560
diff changeset
   233
     * @param memberDetailsTree the content tree to which the documentation will be added
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   234
     * @throws DocletException if there is a problem building the documentation
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16560
diff changeset
   235
     */
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   236
    protected void buildAnnotationTypeFieldDetails(Content memberDetailsTree)
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   237
            throws DocletException {
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   238
        builderFactory.getAnnotationTypeFieldsBuilder(writer).build(memberDetailsTree);
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16560
diff changeset
   239
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16560
diff changeset
   240
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16560
diff changeset
   241
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
     * Build the annotation type optional member documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
     *
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   244
     * @param memberDetailsTree the content tree to which the documentation will be added
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   245
     * @throws DocletException if there is a problem building the documentation
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
     */
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   247
    protected void buildAnnotationTypeOptionalMemberDetails(Content memberDetailsTree)
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   248
            throws DocletException {
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   249
        builderFactory.getAnnotationTypeOptionalMemberBuilder(writer).build(memberDetailsTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
     * Build the annotation type required member documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
     *
7614
cfadc977ca75 6851834: Javadoc doclet needs a structured approach to generate the output HTML.
bpatel
parents: 5855
diff changeset
   255
     * @param memberDetailsTree the content tree to which the documentation will be added
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   256
     * @throws DocletException if there is a problem building the documentation
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   257
     */
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   258
    protected void buildAnnotationTypeRequiredMemberDetails(Content memberDetailsTree)
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 40303
diff changeset
   259
            throws DocletException {
45599
8bc3a019f948 8149146: [javadoc] eliminate doclet.xml
jjg
parents: 40587
diff changeset
   260
        builderFactory.getAnnotationTypeRequiredMemberBuilder(writer).build(memberDetailsTree);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
}