langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/WriterFactoryImpl.java
author jjg
Mon, 22 Aug 2016 16:32:40 -0700
changeset 40587 1c355ea550ed
parent 36526 3b41f1c69604
child 45417 f7479ee8de69
permissions -rw-r--r--
8164130: Simplify doclet IOException handling Reviewed-by: bpatel, ksrini
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
     2
 * Copyright (c) 2003, 2016, 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: 1652
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: 1652
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: 1652
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1652
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1652
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.formats.html;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    28
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    29
import javax.lang.model.element.ModuleElement;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    30
import javax.lang.model.element.PackageElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    31
import javax.lang.model.element.TypeElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    32
import javax.lang.model.type.TypeMirror;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    33
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    34
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeFieldWriter;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    35
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeOptionalMemberWriter;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    36
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeRequiredMemberWriter;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    37
import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeWriter;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    38
import jdk.javadoc.internal.doclets.toolkit.ClassWriter;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    39
import jdk.javadoc.internal.doclets.toolkit.ConstantsSummaryWriter;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    40
import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    41
import jdk.javadoc.internal.doclets.toolkit.ModuleSummaryWriter;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    42
import jdk.javadoc.internal.doclets.toolkit.PackageSummaryWriter;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    43
import jdk.javadoc.internal.doclets.toolkit.SerializedFormWriter;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    44
import jdk.javadoc.internal.doclets.toolkit.WriterFactory;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    45
import jdk.javadoc.internal.doclets.toolkit.util.ClassTree;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    46
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    47
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    48
import static jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberMap.Kind.*;
10
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 factory that returns HTML writers.
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
 *
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    53
 *  <p><b>This is NOT part of any supported API.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    54
 *  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
    55
 *  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
    56
 *  deletion without notice.</b>
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    57
 *
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
 * @author Jamie Ho
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
public class WriterFactoryImpl implements WriterFactory {
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
    62
    private final ConfigurationImpl configuration;
1475
19c0851667ca 6748541: javadoc should be reusable
jjg
parents: 10
diff changeset
    63
    public WriterFactoryImpl(ConfigurationImpl configuration) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
        this.configuration = configuration;
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    70
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
    71
    public ConstantsSummaryWriter getConstantsSummaryWriter() {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
        return new ConstantsSummaryWriterImpl(configuration);
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    78
    @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    79
    public PackageSummaryWriter getPackageSummaryWriter(PackageElement packageElement,
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
    80
            PackageElement prevPkg, PackageElement nextPkg) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    81
        return new PackageWriterImpl(configuration, packageElement, prevPkg, nextPkg);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
     */
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    87
    public ModuleSummaryWriter getModuleSummaryWriter(ModuleElement mdle,
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
    88
        ModuleElement prevModule, ModuleElement nextModule) {
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    89
        return new ModuleWriterImpl(configuration, mdle,
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    90
            prevModule, nextModule);
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    91
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    92
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    93
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    94
     * {@inheritDoc}
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    95
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    96
    @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    97
    public ClassWriter getClassWriter(TypeElement typeElement, TypeElement prevClass,
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
    98
            TypeElement nextClass, ClassTree classTree) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    99
        return new ClassWriterImpl(configuration, typeElement, prevClass, nextClass, classTree);
15723
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   100
    }
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
    /**
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   103
     * {@inheritDoc}
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   104
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   105
    @Override
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   106
    public AnnotationTypeWriter getAnnotationTypeWriter(TypeElement annotationType,
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   107
            TypeMirror prevType, TypeMirror nextType) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   108
        return new AnnotationTypeWriterImpl(configuration, annotationType, prevType, nextType);
15723
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   109
    }
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   110
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
     * {@inheritDoc}
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   113
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   114
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   115
    public AnnotationTypeFieldWriter getAnnotationTypeFieldWriter(
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   116
            AnnotationTypeWriter annotationTypeWriter) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   117
        TypeElement te = annotationTypeWriter.getAnnotationTypeElement();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   118
        return new AnnotationTypeFieldWriterImpl(
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   119
            (SubWriterHolderWriter) annotationTypeWriter, te);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   125
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   126
    public AnnotationTypeOptionalMemberWriter getAnnotationTypeOptionalMemberWriter(
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   127
        AnnotationTypeWriter annotationTypeWriter) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   128
        TypeElement te = annotationTypeWriter.getAnnotationTypeElement();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   129
        return new AnnotationTypeOptionalMemberWriterImpl(
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   130
            (SubWriterHolderWriter) annotationTypeWriter, te);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   136
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   137
    public AnnotationTypeRequiredMemberWriter getAnnotationTypeRequiredMemberWriter(
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   138
            AnnotationTypeWriter annotationTypeWriter) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   139
        TypeElement te = annotationTypeWriter.getAnnotationTypeElement();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   140
        return new AnnotationTypeRequiredMemberWriterImpl(
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   141
            (SubWriterHolderWriter) annotationTypeWriter, te);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   147
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   148
    public EnumConstantWriterImpl getEnumConstantWriter(ClassWriter classWriter) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   149
        return new EnumConstantWriterImpl((SubWriterHolderWriter) classWriter,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   150
                classWriter.getTypeElement());
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   156
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   157
    public FieldWriterImpl getFieldWriter(ClassWriter classWriter) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   158
        return new FieldWriterImpl((SubWriterHolderWriter) classWriter, classWriter.getTypeElement());
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   164
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   165
    public PropertyWriterImpl getPropertyWriter(ClassWriter classWriter) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   166
        return new PropertyWriterImpl((SubWriterHolderWriter) classWriter,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   167
                classWriter.getTypeElement());
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   173
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   174
    public MethodWriterImpl getMethodWriter(ClassWriter classWriter) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   175
        return new MethodWriterImpl((SubWriterHolderWriter) classWriter, classWriter.getTypeElement());
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   181
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   182
    public ConstructorWriterImpl getConstructorWriter(ClassWriter classWriter) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
        return new ConstructorWriterImpl((SubWriterHolderWriter) classWriter,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   184
                classWriter.getTypeElement());
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   190
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   191
    public MemberSummaryWriter getMemberSummaryWriter(ClassWriter classWriter,
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   192
            VisibleMemberMap.Kind memberType) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
        switch (memberType) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   194
            case CONSTRUCTORS:
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   195
                return getConstructorWriter(classWriter);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   196
            case ENUM_CONSTANTS:
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   197
                return getEnumConstantWriter(classWriter);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   198
            case FIELDS:
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   199
                return getFieldWriter(classWriter);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   200
            case PROPERTIES:
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   201
                return getPropertyWriter(classWriter);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   202
            case INNER_CLASSES:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
                return new NestedClassWriterImpl((SubWriterHolderWriter)
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   204
                    classWriter, classWriter.getTypeElement());
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   205
            case METHODS:
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   206
                return getMethodWriter(classWriter);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
            default:
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
                return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
        }
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
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   215
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   216
    public MemberSummaryWriter getMemberSummaryWriter(AnnotationTypeWriter annotationTypeWriter,
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   217
            VisibleMemberMap.Kind memberType) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
        switch (memberType) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   219
            case ANNOTATION_TYPE_FIELDS:
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   220
                return (AnnotationTypeFieldWriterImpl)
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   221
                    getAnnotationTypeFieldWriter(annotationTypeWriter);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   222
            case ANNOTATION_TYPE_MEMBER_OPTIONAL:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
                return (AnnotationTypeOptionalMemberWriterImpl)
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
                    getAnnotationTypeOptionalMemberWriter(annotationTypeWriter);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   225
            case ANNOTATION_TYPE_MEMBER_REQUIRED:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
                return (AnnotationTypeRequiredMemberWriterImpl)
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
                    getAnnotationTypeRequiredMemberWriter(annotationTypeWriter);
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
            default:
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
                return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   236
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   237
    public SerializedFormWriter getSerializedFormWriter() {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   238
        return new SerializedFormWriterImpl(configuration);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
}