langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/BuilderFactory.java
author briangoetz
Wed, 18 Dec 2013 16:05:18 -0500
changeset 22163 3651128c74eb
parent 20237 b6d89903c867
child 24221 2376793dd33b
permissions -rw-r--r--
8030244: Update langtools to use Diamond Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
15723
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
     2
 * Copyright (c) 2003, 2013, 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
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
package com.sun.tools.doclets.internal.toolkit.builders;
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
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 5520
diff changeset
    31
import com.sun.javadoc.*;
15723
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
    32
import com.sun.tools.javac.jvm.Profile;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
import com.sun.tools.doclets.internal.toolkit.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
import com.sun.tools.doclets.internal.toolkit.util.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 * The factory for constructing builders.
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 *
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    39
 *  <p><b>This is NOT part of any supported API.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    40
 *  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
    41
 *  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
    42
 *  deletion without notice.</b>
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
 * @author Jamie Ho
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
 * @since 1.4
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
public class BuilderFactory {
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 current configuration of the doclet.
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
     */
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    53
    private final Configuration configuration;
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 factory to retrieve the required writers from.
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
     */
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    58
    private final WriterFactory writerFactory;
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    59
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    60
    private final AbstractBuilder.Context context;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
     * Construct a builder factory using the given configuration.
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
     * @param configuration the configuration for the current doclet
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
     * being executed.
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
    public BuilderFactory (Configuration configuration) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
        this.configuration = configuration;
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
        this.writerFactory = configuration.getWriterFactory();
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    70
22163
3651128c74eb 8030244: Update langtools to use Diamond
briangoetz
parents: 20237
diff changeset
    71
        Set<String> containingPackagesSeen = new HashSet<>();
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    72
        context = new AbstractBuilder.Context(configuration, containingPackagesSeen,
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    73
                LayoutParser.getInstance(configuration));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
     * Return the builder that builds the constant summary.
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
     * @return the builder that builds the constant summary.
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
    public AbstractBuilder getConstantsSummaryBuider() throws Exception {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    81
        return ConstantsSummaryBuilder.getInstance(context,
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
            writerFactory.getConstantsSummaryWriter());
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
     * Return the builder that builds the package summary.
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
     * @param pkg the package being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
     * @param prevPkg the previous package being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
     * @param nextPkg the next package being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
     * @return the builder that builds the constant summary.
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
    public AbstractBuilder getPackageSummaryBuilder(PackageDoc pkg, PackageDoc prevPkg,
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
            PackageDoc nextPkg) throws Exception {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    95
        return PackageSummaryBuilder.getInstance(context, pkg,
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
            writerFactory.getPackageSummaryWriter(pkg, prevPkg, nextPkg));
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
    /**
15723
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   100
     * Return the builder that builds the profile summary.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   101
     *
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   102
     * @param profile the profile being documented.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   103
     * @param prevProfile the previous profile being documented.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   104
     * @param nextProfile the next profile being documented.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   105
     * @return the builder that builds the profile summary.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   106
     */
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   107
    public AbstractBuilder getProfileSummaryBuilder(Profile profile, Profile prevProfile,
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   108
            Profile nextProfile) throws Exception {
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   109
        return ProfileSummaryBuilder.getInstance(context, profile,
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   110
            writerFactory.getProfileSummaryWriter(profile, prevProfile, nextProfile));
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   111
    }
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   112
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   113
    /**
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   114
     * Return the builder that builds the profile package summary.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   115
     *
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   116
     * @param pkg the profile package being documented.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   117
     * @param prevPkg the previous profile package being documented.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   118
     * @param nextPkg the next profile package being documented.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   119
     * @param profile the profile being documented.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   120
     * @return the builder that builds the profile package summary.
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   121
     */
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   122
    public AbstractBuilder getProfilePackageSummaryBuilder(PackageDoc pkg, PackageDoc prevPkg,
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   123
            PackageDoc nextPkg, Profile profile) throws Exception {
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   124
        return ProfilePackageSummaryBuilder.getInstance(context, pkg,
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   125
            writerFactory.getProfilePackageSummaryWriter(pkg, prevPkg, nextPkg,
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   126
                profile), profile);
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   127
    }
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   128
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   129
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
     * Return the builder for the class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
     * @param classDoc the class being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
     * @param prevClass the previous class that was documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
     * @param nextClass the next class being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
     * @param classTree the class tree.
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
     * @return the writer for the class.  Return null if this
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
     * writer is not supported by the doclet.
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
    public AbstractBuilder getClassBuilder(ClassDoc classDoc,
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   140
            ClassDoc prevClass, ClassDoc nextClass, ClassTree classTree)
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
            throws Exception {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   142
        return ClassBuilder.getInstance(context, classDoc,
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
            writerFactory.getClassWriter(classDoc, prevClass, nextClass,
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
                classTree));
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
     * Return the builder for the annotation type.
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
     * @param annotationType the annotation type being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
     * @param prevType the previous type that was documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
     * @param nextType the next type being documented.
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
     * @return the writer for the annotation type.  Return null if this
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
     * writer is not supported by the doclet.
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
    public AbstractBuilder getAnnotationTypeBuilder(
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
        AnnotationTypeDoc annotationType,
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
        Type prevType, Type nextType)
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
            throws Exception {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   160
        return AnnotationTypeBuilder.getInstance(context, annotationType,
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   161
            writerFactory.getAnnotationTypeWriter(annotationType, prevType, nextType));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
     * Return an instance of the method builder for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
     * @return an instance of the method builder for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
    public AbstractBuilder getMethodBuilder(ClassWriter classWriter)
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
           throws Exception {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   171
        return MethodBuilder.getInstance(context,
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
            classWriter.getClassDoc(),
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
            writerFactory.getMethodWriter(classWriter));
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
    /**
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   177
     * 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
   178
     * class.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   179
     *
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   180
     * @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
   181
     *         annotation type.
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   182
     */
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   183
    public AbstractBuilder getAnnotationTypeFieldsBuilder(
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   184
            AnnotationTypeWriter annotationTypeWriter)
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   185
    throws Exception {
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   186
        return AnnotationTypeFieldBuilder.getInstance(context,
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   187
            annotationTypeWriter.getAnnotationTypeDoc(),
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   188
            writerFactory.getAnnotationTypeFieldWriter(
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   189
                annotationTypeWriter));
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   190
    }
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   191
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   192
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
     * Return an instance of the annotation type member builder for the given
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
     * class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
     *
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   196
     * @return an instance of the annotation type member builder for the given
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
     *         annotation type.
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
    public AbstractBuilder getAnnotationTypeOptionalMemberBuilder(
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
            AnnotationTypeWriter annotationTypeWriter)
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
    throws Exception {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   202
        return AnnotationTypeOptionalMemberBuilder.getInstance(context,
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
            annotationTypeWriter.getAnnotationTypeDoc(),
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
            writerFactory.getAnnotationTypeOptionalMemberWriter(
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
                annotationTypeWriter));
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
     * Return an instance of the annotation type member builder for the given
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
     * class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
     *
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   212
     * @return an instance of the annotation type member builder for the given
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
     *         annotation type.
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
    public AbstractBuilder getAnnotationTypeRequiredMemberBuilder(
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
            AnnotationTypeWriter annotationTypeWriter)
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
    throws Exception {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   218
        return AnnotationTypeRequiredMemberBuilder.getInstance(context,
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
            annotationTypeWriter.getAnnotationTypeDoc(),
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
            writerFactory.getAnnotationTypeRequiredMemberWriter(
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
                annotationTypeWriter));
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
     * Return an instance of the enum constants builder for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
     * @return an instance of the enum constants builder for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
    public AbstractBuilder getEnumConstantsBuilder(ClassWriter classWriter)
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
            throws Exception {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   231
        return EnumConstantBuilder.getInstance(context, classWriter.getClassDoc(),
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
            writerFactory.getEnumConstantWriter(classWriter));
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
     * Return an instance of the field 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 field builder for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
    public AbstractBuilder getFieldBuilder(ClassWriter classWriter)
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
            throws Exception {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   242
        return FieldBuilder.getInstance(context, classWriter.getClassDoc(),
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
            writerFactory.getFieldWriter(classWriter));
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
06bc494ca11e Initial load
duke
parents:
diff changeset
   246
    /**
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   247
     * 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
   248
     *
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   249
     * @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
   250
     */
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   251
    public AbstractBuilder getPropertyBuilder(ClassWriter classWriter) throws Exception {
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   252
        final PropertyWriter propertyWriter =
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   253
                writerFactory.getPropertyWriter(classWriter);
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   254
        return PropertyBuilder.getInstance(context,
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   255
                                           classWriter.getClassDoc(),
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   256
                                           propertyWriter);
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   257
    }
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   258
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   259
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   260
     * Return an instance of the constructor builder for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   261
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
     * @return an instance of the constructor builder for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
    public AbstractBuilder getConstructorBuilder(ClassWriter classWriter)
06bc494ca11e Initial load
duke
parents:
diff changeset
   265
            throws Exception {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   266
        return ConstructorBuilder.getInstance(context,
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   267
            classWriter.getClassDoc(),
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   268
            writerFactory.getConstructorWriter(classWriter));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   269
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
     * Return an instance of the member summary builder for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
     * @return an instance of the member summary builder for the given class.
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   276
    public AbstractBuilder getMemberSummaryBuilder(ClassWriter classWriter)
06bc494ca11e Initial load
duke
parents:
diff changeset
   277
            throws Exception {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   278
        return MemberSummaryBuilder.getInstance(classWriter, context);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   280
06bc494ca11e Initial load
duke
parents:
diff changeset
   281
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   282
     * Return an instance of the member summary builder for the given annotation
06bc494ca11e Initial load
duke
parents:
diff changeset
   283
     * type.
06bc494ca11e Initial load
duke
parents:
diff changeset
   284
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   285
     * @return an instance of the member summary builder for the given
06bc494ca11e Initial load
duke
parents:
diff changeset
   286
     *         annotation type.
06bc494ca11e Initial load
duke
parents:
diff changeset
   287
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   288
    public AbstractBuilder getMemberSummaryBuilder(
06bc494ca11e Initial load
duke
parents:
diff changeset
   289
            AnnotationTypeWriter annotationTypeWriter)
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
    throws Exception {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   291
        return MemberSummaryBuilder.getInstance(annotationTypeWriter, context);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   292
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
06bc494ca11e Initial load
duke
parents:
diff changeset
   294
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   295
     * Return the builder that builds the serialized form.
06bc494ca11e Initial load
duke
parents:
diff changeset
   296
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   297
     * @return the builder that builds the serialized form.
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
    public AbstractBuilder getSerializedFormBuilder()
06bc494ca11e Initial load
duke
parents:
diff changeset
   300
            throws Exception {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   301
        return SerializedFormBuilder.getInstance(context);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   302
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   303
}