langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/BuilderFactory.java
author ksrini
Mon, 05 Jun 2017 13:45:34 -0700
changeset 45417 f7479ee8de69
parent 40587 1c355ea550ed
child 45599 8bc3a019f948
permissions -rw-r--r--
8177848: Rename Configuration(Impl) classes Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
45417
f7479ee8de69 8177848: Rename Configuration(Impl) classes
ksrini
parents: 40587
diff changeset
     2
 * Copyright (c) 2003, 2017, 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: 10
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: 10
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: 10
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
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: 25874
diff changeset
    26
package jdk.javadoc.internal.doclets.toolkit.builders;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    28
import java.util.HashSet;
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    29
import java.util.Set;
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    30
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    31
import javax.lang.model.element.ModuleElement;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    32
import javax.lang.model.element.PackageElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    33
import javax.lang.model.element.TypeElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    34
import javax.lang.model.type.TypeMirror;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    35
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    36
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeWriter;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    37
import jdk.javadoc.internal.doclets.toolkit.ClassWriter;
45417
f7479ee8de69 8177848: Rename Configuration(Impl) classes
ksrini
parents: 40587
diff changeset
    38
import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    39
import jdk.javadoc.internal.doclets.toolkit.PropertyWriter;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    40
import jdk.javadoc.internal.doclets.toolkit.WriterFactory;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    41
import jdk.javadoc.internal.doclets.toolkit.util.ClassTree;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
 * The factory for constructing builders.
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
 *
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    46
 *  <p><b>This is NOT part of any supported API.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    47
 *  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
    48
 *  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
    49
 *  deletion without notice.</b>
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
 * @author Jamie Ho
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
public class BuilderFactory {
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
     * The current configuration of the doclet.
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
     */
45417
f7479ee8de69 8177848: Rename Configuration(Impl) classes
ksrini
parents: 40587
diff changeset
    59
    private final BaseConfiguration configuration;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
     * The factory to retrieve the required writers from.
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
     */
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    64
    private final WriterFactory writerFactory;
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    65
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    66
    private final AbstractBuilder.Context context;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
     * Construct a builder factory using the given configuration.
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
     * @param configuration the configuration for the current doclet
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
     * being executed.
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
     */
45417
f7479ee8de69 8177848: Rename Configuration(Impl) classes
ksrini
parents: 40587
diff changeset
    73
    public BuilderFactory (BaseConfiguration configuration) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
        this.configuration = configuration;
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
        this.writerFactory = configuration.getWriterFactory();
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    76
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    77
        Set<PackageElement> containingPackagesSeen = new HashSet<>();
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    78
        context = new AbstractBuilder.Context(configuration, containingPackagesSeen,
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    79
                LayoutParser.getInstance(configuration));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
     * Return the builder that builds the constant summary.
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
     * @return the builder that builds the constant summary.
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
    86
    public AbstractBuilder getConstantsSummaryBuilder() {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    87
        return ConstantsSummaryBuilder.getInstance(context,
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
            writerFactory.getConstantsSummaryWriter());
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
     * Return the builder that builds the package summary.
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
     * @param pkg the package being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
     * @param prevPkg the previous package being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
     * @param nextPkg the next package being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
     * @return the builder that builds the constant summary.
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    99
    public AbstractBuilder getPackageSummaryBuilder(PackageElement pkg, PackageElement prevPkg,
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   100
            PackageElement nextPkg) {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   101
        return PackageSummaryBuilder.getInstance(context, pkg,
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
            writerFactory.getPackageSummaryWriter(pkg, prevPkg, nextPkg));
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
    /**
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   106
     * Return the builder that builds the module summary.
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   107
     *
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   108
     * @param mdle the module being documented.
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   109
     * @param prevModule the previous module being documented.
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   110
     * @param nextModule the next module being documented.
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   111
     * @return the builder that builds the module summary.
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   112
     */
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   113
    public AbstractBuilder getModuleSummaryBuilder(ModuleElement mdle, ModuleElement prevModule,
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   114
            ModuleElement nextModule) {
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   115
        return ModuleSummaryBuilder.getInstance(context, mdle,
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   116
            writerFactory.getModuleSummaryWriter(mdle, prevModule, nextModule));
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   117
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   118
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   119
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
     * Return the builder for the class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
     *
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   122
     * @param typeElement the class being documented.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
     * @param prevClass the previous class that was documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
     * @param nextClass the next class being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
     * @param classTree the class tree.
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
     * @return the writer for the class.  Return null if this
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
     * writer is not supported by the doclet.
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   129
    public AbstractBuilder getClassBuilder(TypeElement typeElement,
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   130
            TypeElement prevClass, TypeElement nextClass, ClassTree classTree) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   131
        return ClassBuilder.getInstance(context, typeElement,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   132
            writerFactory.getClassWriter(typeElement, prevClass, nextClass, classTree));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
     * Return the builder for the annotation type.
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
     * @param annotationType the annotation type being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
     * @param prevType the previous type that was documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
     * @param nextType the next type being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
     * @return the writer for the annotation type.  Return null if this
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
     * writer is not supported by the doclet.
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
    public AbstractBuilder getAnnotationTypeBuilder(
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   145
        TypeElement annotationType, TypeMirror prevType, TypeMirror nextType) {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   146
        return AnnotationTypeBuilder.getInstance(context, annotationType,
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   147
            writerFactory.getAnnotationTypeWriter(annotationType, prevType, nextType));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
     * Return an instance of the method builder for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
     * @return an instance of the method builder for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   155
    public AbstractBuilder getMethodBuilder(ClassWriter classWriter) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   156
        return MethodBuilder.getInstance(context, classWriter.getTypeElement(),
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
            writerFactory.getMethodWriter(classWriter));
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
    /**
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   161
     * Return an instance of the annotation type fields builder for the given
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   162
     * class.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   163
     *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   164
     * @return an instance of the annotation type field builder for the given
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   165
     *         annotation type.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   166
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   167
    public AbstractBuilder getAnnotationTypeFieldsBuilder(
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   168
            AnnotationTypeWriter annotationTypeWriter) {
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   169
        return AnnotationTypeFieldBuilder.getInstance(context,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   170
                annotationTypeWriter.getAnnotationTypeElement(),
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   171
                writerFactory.getAnnotationTypeFieldWriter(annotationTypeWriter));
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   172
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   173
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   174
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
     * Return an instance of the annotation type member builder for the given
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
     * class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
     *
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   178
     * @return an instance of the annotation type member builder for the given
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
     *         annotation type.
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
    public AbstractBuilder getAnnotationTypeOptionalMemberBuilder(
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   182
            AnnotationTypeWriter annotationTypeWriter) {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   183
        return AnnotationTypeOptionalMemberBuilder.getInstance(context,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   184
            annotationTypeWriter.getAnnotationTypeElement(),
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   185
            writerFactory.getAnnotationTypeOptionalMemberWriter(annotationTypeWriter));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
     * Return an instance of the annotation type member builder for the given
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
     * class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
     *
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   192
     * @return an instance of the annotation type member builder for the given
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
     *         annotation type.
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
    public AbstractBuilder getAnnotationTypeRequiredMemberBuilder(
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   196
            AnnotationTypeWriter annotationTypeWriter) {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   197
        return AnnotationTypeRequiredMemberBuilder.getInstance(context,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   198
            annotationTypeWriter.getAnnotationTypeElement(),
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   199
            writerFactory.getAnnotationTypeRequiredMemberWriter(annotationTypeWriter));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
     * Return an instance of the enum constants builder for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
     * @return an instance of the enum constants builder for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   207
    public AbstractBuilder getEnumConstantsBuilder(ClassWriter classWriter) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   208
        return EnumConstantBuilder.getInstance(context, classWriter.getTypeElement(),
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   209
                writerFactory.getEnumConstantWriter(classWriter));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
     * Return an instance of the field builder for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
     * @return an instance of the field builder for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   217
    public AbstractBuilder getFieldBuilder(ClassWriter classWriter) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   218
        return FieldBuilder.getInstance(context, classWriter.getTypeElement(),
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
            writerFactory.getFieldWriter(classWriter));
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
    /**
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   223
     * Return an instance of the property builder for the given class.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   224
     *
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   225
     * @return an instance of the field builder for the given class.
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   226
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   227
    public AbstractBuilder getPropertyBuilder(ClassWriter classWriter) {
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   228
        final PropertyWriter propertyWriter =
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   229
                writerFactory.getPropertyWriter(classWriter);
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   230
        return PropertyBuilder.getInstance(context,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   231
                                           classWriter.getTypeElement(),
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   232
                                           propertyWriter);
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   233
    }
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   234
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   235
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
     * Return an instance of the constructor builder for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   238
     * @return an instance of the constructor builder for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   240
    public AbstractBuilder getConstructorBuilder(ClassWriter classWriter) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   241
        return ConstructorBuilder.getInstance(context, classWriter.getTypeElement(),
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   242
            writerFactory.getConstructorWriter(classWriter));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
     * Return an instance of the member summary builder for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
     * @return an instance of the member summary builder for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   250
    public AbstractBuilder getMemberSummaryBuilder(ClassWriter classWriter) {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   251
        return MemberSummaryBuilder.getInstance(classWriter, context);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   255
     * Return an instance of the member summary builder for the given annotation
06bc494ca11e Initial load
duke
parents:
diff changeset
   256
     * type.
06bc494ca11e Initial load
duke
parents:
diff changeset
   257
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   258
     * @return an instance of the member summary builder for the given
06bc494ca11e Initial load
duke
parents:
diff changeset
   259
     *         annotation type.
06bc494ca11e Initial load
duke
parents:
diff changeset
   260
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   261
    public AbstractBuilder getMemberSummaryBuilder(AnnotationTypeWriter annotationTypeWriter) {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   262
        return MemberSummaryBuilder.getInstance(annotationTypeWriter, context);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
     * Return the builder that builds the serialized form.
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   268
     * @return the builder that builds the serialized form.
06bc494ca11e Initial load
duke
parents:
diff changeset
   269
     */
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   270
    public AbstractBuilder getSerializedFormBuilder() {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   271
        return SerializedFormBuilder.getInstance(context);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
}