src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/WriterFactoryImpl.java
author ksrini
Tue, 24 Apr 2018 11:54:03 -0700
changeset 49879 601277b1d582
parent 48756 ce608a09a666
permissions -rw-r--r--
8025091: VisibleMemberMap.java possible performance improvements 8198890: The standard doclet incorrectly produces wrong method signatures in certain cases. Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
49879
601277b1d582 8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents: 48756
diff changeset
     2
 * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 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
48029
e9dab2492924 8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents: 47216
diff changeset
    29
import javax.lang.model.element.Element;
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    30
import javax.lang.model.element.ModuleElement;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    31
import javax.lang.model.element.PackageElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    32
import javax.lang.model.element.TypeElement;
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;
48029
e9dab2492924 8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents: 47216
diff changeset
    40
import jdk.javadoc.internal.doclets.toolkit.DocFilesHandler;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    41
import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    42
import jdk.javadoc.internal.doclets.toolkit.ModuleSummaryWriter;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    43
import jdk.javadoc.internal.doclets.toolkit.PackageSummaryWriter;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    44
import jdk.javadoc.internal.doclets.toolkit.SerializedFormWriter;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    45
import jdk.javadoc.internal.doclets.toolkit.WriterFactory;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    46
import jdk.javadoc.internal.doclets.toolkit.util.ClassTree;
49879
601277b1d582 8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents: 48756
diff changeset
    47
import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    48
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
 * The factory that returns HTML writers.
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
 *
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    52
 *  <p><b>This is NOT part of any supported API.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    53
 *  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
    54
 *  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
    55
 *  deletion without notice.</b>
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14258
diff changeset
    56
 *
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
 * @author Jamie Ho
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
public class WriterFactoryImpl implements WriterFactory {
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
45417
f7479ee8de69 8177848: Rename Configuration(Impl) classes
ksrini
parents: 40587
diff changeset
    61
    private final HtmlConfiguration configuration;
f7479ee8de69 8177848: Rename Configuration(Impl) classes
ksrini
parents: 40587
diff changeset
    62
    public WriterFactoryImpl(HtmlConfiguration configuration) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
        this.configuration = configuration;
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    69
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
    70
    public ConstantsSummaryWriter getConstantsSummaryWriter() {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
        return new ConstantsSummaryWriterImpl(configuration);
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    77
    @Override
48756
ce608a09a666 8196027: Remove "Prev" and "Next" links from the javadoc navigation
bpatel
parents: 48029
diff changeset
    78
    public PackageSummaryWriter getPackageSummaryWriter(PackageElement packageElement) {
ce608a09a666 8196027: Remove "Prev" and "Next" links from the javadoc navigation
bpatel
parents: 48029
diff changeset
    79
        return new PackageWriterImpl(configuration, packageElement);
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
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
     */
48756
ce608a09a666 8196027: Remove "Prev" and "Next" links from the javadoc navigation
bpatel
parents: 48029
diff changeset
    85
    public ModuleSummaryWriter getModuleSummaryWriter(ModuleElement mdle) {
ce608a09a666 8196027: Remove "Prev" and "Next" links from the javadoc navigation
bpatel
parents: 48029
diff changeset
    86
        return new ModuleWriterImpl(configuration, mdle);
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    87
    }
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    88
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    89
    /**
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    90
     * {@inheritDoc}
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    91
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    92
    @Override
48756
ce608a09a666 8196027: Remove "Prev" and "Next" links from the javadoc navigation
bpatel
parents: 48029
diff changeset
    93
    public ClassWriter getClassWriter(TypeElement typeElement, ClassTree classTree) {
ce608a09a666 8196027: Remove "Prev" and "Next" links from the javadoc navigation
bpatel
parents: 48029
diff changeset
    94
        return new ClassWriterImpl(configuration, typeElement, classTree);
15723
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
    95
    }
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
    96
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
    97
    /**
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
    98
     * {@inheritDoc}
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
    99
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   100
    @Override
48756
ce608a09a666 8196027: Remove "Prev" and "Next" links from the javadoc navigation
bpatel
parents: 48029
diff changeset
   101
    public AnnotationTypeWriter getAnnotationTypeWriter(TypeElement annotationType) {
ce608a09a666 8196027: Remove "Prev" and "Next" links from the javadoc navigation
bpatel
parents: 48029
diff changeset
   102
        return new AnnotationTypeWriterImpl(configuration, annotationType);
15723
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   103
    }
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   104
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   105
    /**
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   106
     * {@inheritDoc}
58a73dac9ee4 8006124: javadoc/doclet should be updated to support profiles
bpatel
parents: 14542
diff changeset
   107
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   108
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   109
    public AnnotationTypeFieldWriter getAnnotationTypeFieldWriter(
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   110
            AnnotationTypeWriter annotationTypeWriter) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   111
        TypeElement te = annotationTypeWriter.getAnnotationTypeElement();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   112
        return new AnnotationTypeFieldWriterImpl(
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   113
            (SubWriterHolderWriter) annotationTypeWriter, te);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   119
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   120
    public AnnotationTypeOptionalMemberWriter getAnnotationTypeOptionalMemberWriter(
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   121
        AnnotationTypeWriter annotationTypeWriter) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   122
        TypeElement te = annotationTypeWriter.getAnnotationTypeElement();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   123
        return new AnnotationTypeOptionalMemberWriterImpl(
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   124
            (SubWriterHolderWriter) annotationTypeWriter, te);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   130
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   131
    public AnnotationTypeRequiredMemberWriter getAnnotationTypeRequiredMemberWriter(
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   132
            AnnotationTypeWriter annotationTypeWriter) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   133
        TypeElement te = annotationTypeWriter.getAnnotationTypeElement();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   134
        return new AnnotationTypeRequiredMemberWriterImpl(
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   135
            (SubWriterHolderWriter) annotationTypeWriter, te);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   141
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   142
    public EnumConstantWriterImpl getEnumConstantWriter(ClassWriter classWriter) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   143
        return new EnumConstantWriterImpl((SubWriterHolderWriter) classWriter,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   144
                classWriter.getTypeElement());
10
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
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   150
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   151
    public FieldWriterImpl getFieldWriter(ClassWriter classWriter) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   152
        return new FieldWriterImpl((SubWriterHolderWriter) classWriter, classWriter.getTypeElement());
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   158
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   159
    public PropertyWriterImpl getPropertyWriter(ClassWriter classWriter) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   160
        return new PropertyWriterImpl((SubWriterHolderWriter) classWriter,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   161
                classWriter.getTypeElement());
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
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   167
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   168
    public MethodWriterImpl getMethodWriter(ClassWriter classWriter) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   169
        return new MethodWriterImpl((SubWriterHolderWriter) classWriter, classWriter.getTypeElement());
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   175
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   176
    public ConstructorWriterImpl getConstructorWriter(ClassWriter classWriter) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
        return new ConstructorWriterImpl((SubWriterHolderWriter) classWriter,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   178
                classWriter.getTypeElement());
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   184
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   185
    public MemberSummaryWriter getMemberSummaryWriter(ClassWriter classWriter,
49879
601277b1d582 8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents: 48756
diff changeset
   186
            VisibleMemberTable.Kind memberType) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
        switch (memberType) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   188
            case CONSTRUCTORS:
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   189
                return getConstructorWriter(classWriter);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   190
            case ENUM_CONSTANTS:
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   191
                return getEnumConstantWriter(classWriter);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   192
            case FIELDS:
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   193
                return getFieldWriter(classWriter);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   194
            case PROPERTIES:
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 15723
diff changeset
   195
                return getPropertyWriter(classWriter);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   196
            case INNER_CLASSES:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
                return new NestedClassWriterImpl((SubWriterHolderWriter)
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   198
                    classWriter, classWriter.getTypeElement());
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   199
            case METHODS:
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   200
                return getMethodWriter(classWriter);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
            default:
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
                return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   209
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   210
    public MemberSummaryWriter getMemberSummaryWriter(AnnotationTypeWriter annotationTypeWriter,
49879
601277b1d582 8025091: VisibleMemberMap.java possible performance improvements
ksrini
parents: 48756
diff changeset
   211
            VisibleMemberTable.Kind memberType) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
        switch (memberType) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   213
            case ANNOTATION_TYPE_FIELDS:
20237
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   214
                return (AnnotationTypeFieldWriterImpl)
b6d89903c867 8015249: javadoc fails to document static final fields in annotation types
bpatel
parents: 16319
diff changeset
   215
                    getAnnotationTypeFieldWriter(annotationTypeWriter);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   216
            case ANNOTATION_TYPE_MEMBER_OPTIONAL:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
                return (AnnotationTypeOptionalMemberWriterImpl)
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
                    getAnnotationTypeOptionalMemberWriter(annotationTypeWriter);
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   219
            case ANNOTATION_TYPE_MEMBER_REQUIRED:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
                return (AnnotationTypeRequiredMemberWriterImpl)
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
                    getAnnotationTypeRequiredMemberWriter(annotationTypeWriter);
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
            default:
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
                return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   230
    @Override
40587
1c355ea550ed 8164130: Simplify doclet IOException handling
jjg
parents: 36526
diff changeset
   231
    public SerializedFormWriter getSerializedFormWriter() {
14542
7062120649c2 8000800: javadoc uses static non-final fields
jjg
parents: 14260
diff changeset
   232
        return new SerializedFormWriterImpl(configuration);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
    }
48029
e9dab2492924 8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents: 47216
diff changeset
   234
e9dab2492924 8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents: 47216
diff changeset
   235
    /**
e9dab2492924 8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents: 47216
diff changeset
   236
     * {@inheritDoc}
e9dab2492924 8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents: 47216
diff changeset
   237
     */
e9dab2492924 8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents: 47216
diff changeset
   238
    @Override
e9dab2492924 8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents: 47216
diff changeset
   239
    public DocFilesHandler getDocFilesHandler(Element element) {
e9dab2492924 8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents: 47216
diff changeset
   240
        return new DocFilesHandlerImpl(configuration, element);
e9dab2492924 8185985: Html files in doc-files directories should be wrapped with standard header and footer
ksrini
parents: 47216
diff changeset
   241
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   242
}