langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java
author ksrini
Mon, 05 Jun 2017 13:45:34 -0700
changeset 45417 f7479ee8de69
parent 44564 4e1df2513486
permissions -rw-r--r--
8177848: Rename Configuration(Impl) classes Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
     1
/*
44297
e03f5fb3714b 8175200: Long method signatures disturb Method Summary table
bpatel
parents: 42816
diff changeset
     2
 * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
     4
 *
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    10
 *
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    15
 * accompanied this code).
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    16
 *
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    20
 *
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    23
 * questions.
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    24
 */
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    25
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    26
package jdk.javadoc.internal.doclets.formats.html;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    27
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    28
import java.util.regex.Matcher;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    29
import java.util.regex.Pattern;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    30
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    31
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    32
import jdk.javadoc.internal.doclets.formats.html.markup.FixedStringContent;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    33
import jdk.javadoc.internal.doclets.formats.html.markup.RawHtml;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    34
import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    35
import jdk.javadoc.internal.doclets.toolkit.Content;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    36
import jdk.javadoc.internal.doclets.toolkit.Resources;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    37
import jdk.javadoc.internal.doclets.toolkit.util.DocletConstants;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    38
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    39
/**
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    40
 * Constants and factory methods for common fragments of content
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    41
 * used by HtmlDoclet. The string content of these fragments is
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    42
 * generally obtained from the {@link Resources resources} found
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    43
 * in the doclet's configuration.
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    44
 *
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    45
 * @implNote
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    46
 * Many constants are made available in this class, so that they are
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    47
 * only created once per doclet-instance, instead of once per generated page.
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    48
 */
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    49
public class Contents {
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    50
    public static final Content SPACE = RawHtml.nbsp;
44297
e03f5fb3714b 8175200: Long method signatures disturb Method Summary table
bpatel
parents: 42816
diff changeset
    51
    public static final Content ZERO_WIDTH_SPACE = RawHtml.zws;
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    52
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    53
    public final Content allClassesLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    54
    public final Content allImplementedInterfacesLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    55
    public final Content allModulesLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    56
    public final Content allPackagesLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    57
    public final Content allSuperinterfacesLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    58
    public final Content also;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    59
    public final Content annotateTypeOptionalMemberSummaryLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    60
    public final Content annotateTypeRequiredMemberSummaryLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    61
    public final Content annotationType;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    62
    public final Content annotationTypeDetailsLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    63
    public final Content annotationTypeMemberDetail;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    64
    public final Content annotationTypes;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    65
    public final Content classLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    66
    public final Content classes;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    67
    public final Content constantsSummaryTitle;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    68
    public final Content constructorDetailsLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    69
    public final Content constructorSummaryLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    70
    public final Content constructors;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    71
    public final Content contentsHeading;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    72
    public final Content defaultPackageLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    73
    public final Content default_;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    74
    public final Content deprecatedAPI;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    75
    public final Content deprecatedLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    76
    public final Content deprecatedPhrase;
42816
3638773ff1b0 8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents: 40511
diff changeset
    77
    public final Content deprecatedForRemovalPhrase;
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    78
    public final Content descfrmClassLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    79
    public final Content descfrmInterfaceLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    80
    public final Content descriptionLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    81
    public final Content detailLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    82
    public final Content enclosingClassLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    83
    public final Content enclosingInterfaceLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    84
    public final Content enumConstantDetailLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    85
    public final Content enumConstantSummary;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    86
    public final Content enum_;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    87
    public final Content enums;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    88
    public final Content errors;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    89
    public final Content exceptions;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    90
    public final Content fieldDetailsLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    91
    public final Content fieldSummaryLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    92
    public final Content fields;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    93
    public final Content framesLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    94
    public final Content functionalInterface;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    95
    public final Content functionalInterfaceMessage;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    96
    public final Content helpLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    97
    public final Content hierarchyForAllPackages;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    98
    public final Content implementation;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
    99
    public final Content implementingClassesLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   100
    public final Content inClass;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   101
    public final Content inInterface;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   102
    public final Content indexLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   103
    public final Content interfaces;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   104
    public final Content interfacesItalic;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   105
    public final Content methodDetailLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   106
    public final Content methodSummary;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   107
    public final Content methods;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   108
    public final Content moduleLabel;
40511
1b3c502e0bdc 8155995: Update javadoc to include module search
bpatel
parents: 40303
diff changeset
   109
    public final Content module_;
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   110
    public final Content moduleSubNavLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   111
    public final Content modulesLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   112
    public final Content navAnnotationTypeMember;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   113
    public final Content navAnnotationTypeOptionalMember;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   114
    public final Content navAnnotationTypeRequiredMember;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   115
    public final Content navConstructor;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   116
    public final Content navEnum;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   117
    public final Content navField;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   118
    public final Content navMethod;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   119
    public final Content navModuleDescription;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   120
    public final Content navModules;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   121
    public final Content navNested;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   122
    public final Content navPackages;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   123
    public final Content navProperty;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   124
    public final Content navServices;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   125
    public final Content nestedClassSummary;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   126
    public final Content nextClassLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   127
    public final Content nextLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   128
    public final Content nextLetter;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   129
    public final Content nextModuleLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   130
    public final Content nextPackageLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   131
    public final Content noFramesLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   132
    public final Content noScriptMessage;
44564
4e1df2513486 8177562: Small updates to module summary page
jjg
parents: 44297
diff changeset
   133
    public final Content openModuleLabel;
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   134
    public final Content overridesLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   135
    public final Content overviewLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   136
    public final Content packageHierarchies;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   137
    public final Content packageLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   138
    public final Content package_;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   139
    public final Content packagesLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   140
    public final Content prevClassLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   141
    public final Content prevLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   142
    public final Content prevLetter;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   143
    public final Content prevModuleLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   144
    public final Content prevPackageLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   145
    public final Content properties;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   146
    public final Content propertyDetailsLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   147
    public final Content propertySummary;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   148
    public final Content seeLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   149
    public final Content serializedForm;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   150
    public final Content specifiedByLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   151
    public final Content subclassesLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   152
    public final Content subinterfacesLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   153
    public final Content summaryLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   154
    public final Content treeLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   155
    public final Content useLabel;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   156
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   157
    private final Resources resources;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   158
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   159
    /**
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   160
     * Creates a {@code Contents} object.
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   161
     *
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   162
     * @param configuration the configuration in which to find the
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   163
     * resources used to look up resource keys, and other details.
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   164
     */
45417
f7479ee8de69 8177848: Rename Configuration(Impl) classes
ksrini
parents: 44564
diff changeset
   165
    Contents(HtmlConfiguration configuration) {
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   166
        this.resources = configuration.getResources();
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   167
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   168
        allClassesLabel = getNonBreakContent("doclet.All_Classes");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   169
        allImplementedInterfacesLabel = getContent("doclet.All_Implemented_Interfaces");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   170
        allModulesLabel = getNonBreakContent("doclet.All_Modules");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   171
        allPackagesLabel = getNonBreakContent("doclet.All_Packages");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   172
        allSuperinterfacesLabel = getContent("doclet.All_Superinterfaces");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   173
        also = getContent("doclet.also");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   174
        annotateTypeOptionalMemberSummaryLabel = getContent("doclet.Annotation_Type_Optional_Member_Summary");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   175
        annotateTypeRequiredMemberSummaryLabel = getContent("doclet.Annotation_Type_Required_Member_Summary");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   176
        annotationType = getContent("doclet.AnnotationType");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   177
        annotationTypeDetailsLabel = getContent("doclet.Annotation_Type_Member_Detail");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   178
        annotationTypeMemberDetail = getContent("doclet.Annotation_Type_Member_Detail");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   179
        annotationTypes = getContent("doclet.AnnotationTypes");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   180
        classLabel = getContent("doclet.Class");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   181
        classes = getContent("doclet.Classes");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   182
        constantsSummaryTitle = getContent("doclet.Constants_Summary");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   183
        constructorDetailsLabel = getContent("doclet.Constructor_Detail");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   184
        constructorSummaryLabel = getContent("doclet.Constructor_Summary");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   185
        constructors = getContent("doclet.Constructors");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   186
        contentsHeading = getContent("doclet.Contents");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   187
        defaultPackageLabel = new StringContent(DocletConstants.DEFAULT_PACKAGE_NAME);
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   188
        default_ = getContent("doclet.Default");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   189
        deprecatedAPI = getContent("doclet.Deprecated_API");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   190
        deprecatedLabel = getContent("doclet.navDeprecated");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   191
        deprecatedPhrase = getContent("doclet.Deprecated");
42816
3638773ff1b0 8162674: change javadoc output text and style emitted by for-removal deprecations
bpatel
parents: 40511
diff changeset
   192
        deprecatedForRemovalPhrase = getContent("doclet.DeprecatedForRemoval");
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   193
        descfrmClassLabel = getContent("doclet.Description_From_Class");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   194
        descfrmInterfaceLabel = getContent("doclet.Description_From_Interface");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   195
        descriptionLabel = getContent("doclet.Description");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   196
        detailLabel = getContent("doclet.Detail");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   197
        enclosingClassLabel = getContent("doclet.Enclosing_Class");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   198
        enclosingInterfaceLabel = getContent("doclet.Enclosing_Interface");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   199
        enumConstantDetailLabel = getContent("doclet.Enum_Constant_Detail");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   200
        enumConstantSummary = getContent("doclet.Enum_Constant_Summary");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   201
        enum_ = getContent("doclet.Enum");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   202
        enums = getContent("doclet.Enums");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   203
        errors = getContent("doclet.Errors");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   204
        exceptions = getContent("doclet.Exceptions");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   205
        fieldDetailsLabel = getContent("doclet.Field_Detail");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   206
        fieldSummaryLabel = getContent("doclet.Field_Summary");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   207
        fields = getContent("doclet.Fields");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   208
        framesLabel = getContent("doclet.Frames");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   209
        functionalInterface = getContent("doclet.Functional_Interface");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   210
        functionalInterfaceMessage = getContent("doclet.Functional_Interface_Message");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   211
        helpLabel = getContent("doclet.Help");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   212
        hierarchyForAllPackages = getContent("doclet.Hierarchy_For_All_Packages");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   213
        implementation = getContent("doclet.Implementation");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   214
        implementingClassesLabel = getContent("doclet.Implementing_Classes");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   215
        inClass = getContent("doclet.in_class");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   216
        inInterface = getContent("doclet.in_interface");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   217
        indexLabel = getContent("doclet.Index");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   218
        interfaces = getContent("doclet.Interfaces");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   219
        interfacesItalic = getContent("doclet.Interfaces_Italic");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   220
        methodDetailLabel = getContent("doclet.Method_Detail");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   221
        methodSummary = getContent("doclet.Method_Summary");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   222
        methods = getContent("doclet.Methods");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   223
        moduleLabel = getContent("doclet.Module");
40511
1b3c502e0bdc 8155995: Update javadoc to include module search
bpatel
parents: 40303
diff changeset
   224
        module_ = getContent("doclet.module");
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   225
        moduleSubNavLabel = getContent("doclet.Module_Sub_Nav");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   226
        modulesLabel = getContent("doclet.Modules");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   227
        navAnnotationTypeMember = getContent("doclet.navAnnotationTypeMember");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   228
        navAnnotationTypeOptionalMember = getContent("doclet.navAnnotationTypeOptionalMember");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   229
        navAnnotationTypeRequiredMember = getContent("doclet.navAnnotationTypeRequiredMember");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   230
        navConstructor = getContent("doclet.navConstructor");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   231
        navEnum = getContent("doclet.navEnum");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   232
        navField = getContent("doclet.navField");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   233
        navMethod = getContent("doclet.navMethod");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   234
        navModuleDescription = getContent("doclet.navModuleDescription");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   235
        navModules = getContent("doclet.navModules");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   236
        navNested = getContent("doclet.navNested");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   237
        navPackages = getContent("doclet.navPackages");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   238
        navProperty = getContent("doclet.navProperty");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   239
        navServices = getContent("doclet.navServices");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   240
        nestedClassSummary = getContent("doclet.Nested_Class_Summary");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   241
        nextClassLabel = getNonBreakContent("doclet.Next_Class");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   242
        nextLabel = getNonBreakContent("doclet.Next");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   243
        nextLetter = getContent("doclet.Next_Letter");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   244
        nextModuleLabel = getNonBreakContent("doclet.Next_Module");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   245
        nextPackageLabel = getNonBreakContent("doclet.Next_Package");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   246
        noFramesLabel = getNonBreakContent("doclet.No_Frames");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   247
        noScriptMessage = getContent("doclet.No_Script_Message");
44564
4e1df2513486 8177562: Small updates to module summary page
jjg
parents: 44297
diff changeset
   248
        openModuleLabel = getContent("doclet.Open_Module");
40303
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   249
        overridesLabel = getContent("doclet.Overrides");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   250
        overviewLabel = getContent("doclet.Overview");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   251
        packageHierarchies = getContent("doclet.Package_Hierarchies");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   252
        packageLabel = getContent("doclet.Package");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   253
        package_ = getContent("doclet.package");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   254
        packagesLabel = getContent("doclet.Packages");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   255
        prevClassLabel = getNonBreakContent("doclet.Prev_Class");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   256
        prevLabel = getContent("doclet.Prev");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   257
        prevLetter = getContent("doclet.Prev_Letter");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   258
        prevModuleLabel = getNonBreakContent("doclet.Prev_Module");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   259
        prevPackageLabel = getNonBreakContent("doclet.Prev_Package");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   260
        properties = getContent("doclet.Properties");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   261
        propertyDetailsLabel = getContent("doclet.Property_Detail");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   262
        propertySummary = getContent("doclet.Property_Summary");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   263
        seeLabel = getContent("doclet.See");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   264
        serializedForm = getContent("doclet.Serialized_Form");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   265
        specifiedByLabel = getContent("doclet.Specified_By");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   266
        subclassesLabel = getContent("doclet.Subclasses");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   267
        subinterfacesLabel = getContent("doclet.Subinterfaces");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   268
        summaryLabel = getContent("doclet.Summary");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   269
        treeLabel = getContent("doclet.Tree");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   270
        useLabel = getContent("doclet.navClassUse");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   271
    }
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   272
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   273
    /**
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   274
     * Gets a {@code Content} object, containing the string for
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   275
     * a given key in the doclet's resources.
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   276
     *
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   277
     * @param key the key for the desired string
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   278
     * @return a content tree for the string
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   279
     */
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   280
    public Content getContent(String key) {
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   281
        return new FixedStringContent(resources.getText(key));
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   282
    }
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   283
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   284
    /**
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   285
     * Gets a {@code Content} object, containing the string for
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   286
     * a given key in the doclet's resources, formatted with
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   287
     * given arguments.
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   288
     *
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   289
     * @param key the key to look for in the configuration fil
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   290
     * @param key the key for the desired string
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   291
     * @param o0  string or content argument to be formatted into the result
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   292
     * @return a content tree for the text
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   293
     */
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   294
    public Content getContent(String key, Object o0) {
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   295
        return getContent(key, o0, null, null);
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   296
    }
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   297
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   298
    /**
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   299
     * Gets a {@code Content} object, containing the string for
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   300
     * a given key in the doclet's resources, formatted with
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   301
     * given arguments.
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   302
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   303
     * @param key the key for the desired string
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   304
     * @param o0  string or content argument to be formatted into the result
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   305
     * @param o1  string or content argument to be formatted into the result
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   306
     * @return a content tree for the text
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   307
     */
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   308
    public Content getContent(String key, Object o0, Object o1) {
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   309
        return getContent(key, o0, o1, null);
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   310
    }
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   311
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   312
    /**
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   313
     * Gets a {@code Content} object, containing the string for
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   314
     * a given key in the doclet's resources, formatted with
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   315
     * given arguments.
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   316
     *
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   317
     * @param key the key for the desired string
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   318
     * @param o0  string or content argument to be formatted into the result
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   319
     * @param o1  string or content argument to be formatted into the result
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   320
     * @param o2  string or content argument to be formatted into the result
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   321
     * @return a content tree for the text
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   322
     */
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   323
    public Content getContent(String key, Object o0, Object o1, Object o2) {
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   324
        Content c = new ContentBuilder();
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   325
        Pattern p = Pattern.compile("\\{([012])\\}");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   326
        String text = resources.getText(key); // TODO: cache
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   327
        Matcher m = p.matcher(text);
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   328
        int start = 0;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   329
        while (m.find(start)) {
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   330
            c.addContent(text.substring(start, m.start()));
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   331
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   332
            Object o = null;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   333
            switch (m.group(1).charAt(0)) {
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   334
                case '0': o = o0; break;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   335
                case '1': o = o1; break;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   336
                case '2': o = o2; break;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   337
            }
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   338
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   339
            if (o == null) {
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   340
                c.addContent("{" + m.group(1) + "}");
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   341
            } else if (o instanceof String) {
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   342
                c.addContent((String) o);
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   343
            } else if (o instanceof Content) {
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   344
                c.addContent((Content) o);
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   345
            }
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   346
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   347
            start = m.end();
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   348
        }
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   349
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   350
        c.addContent(text.substring(start));
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   351
        return c;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   352
    }
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   353
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   354
    /**
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   355
     * Gets a {@code Content} object, containing the string for
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   356
     * a given key in the doclet's resources, substituting
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   357
     * <code>&nbsp;</code> for any space characters found in
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   358
     * the named resource string.
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   359
     *
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   360
     * @param key the key for the desired string
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   361
     * @return a content tree for the string
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   362
     */
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   363
    private Content getNonBreakContent(String key) {
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   364
        String text = resources.getText(key); // TODO: cache
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   365
        Content c = new ContentBuilder();
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   366
        int start = 0;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   367
        int p;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   368
        while ((p = text.indexOf(" ", start)) != -1) {
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   369
            c.addContent(text.substring(start, p));
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   370
            c.addContent(RawHtml.nbsp);
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   371
            start = p + 1;
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   372
        }
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   373
        c.addContent(text.substring(start));
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   374
        return c; // TODO: should be made immutable
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   375
    }
96a1226aca18 8160697: HTMLWriter needs perf cleanup
jjg
parents:
diff changeset
   376
}