langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java
author mcimadamore
Tue, 13 Jan 2009 13:27:14 +0000
changeset 1789 7ac8c0815000
parent 1787 1aa079321cd2
child 5520 86e4b9a9da40
permissions -rw-r--r--
6765045: Remove rawtypes warnings from langtools Summary: Removed all occurrences of rawtypes warnings from langtools Reviewed-by: jjg, bpatel
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
06bc494ca11e Initial load
duke
parents:
diff changeset
     2
 * Copyright 2003-2004 Sun Microsystems, Inc.  All Rights Reserved.
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
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
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
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
 * have any questions.
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
package com.sun.tools.doclets.formats.html;
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
import com.sun.javadoc.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
import com.sun.tools.doclets.internal.toolkit.util.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
import com.sun.tools.doclets.internal.toolkit.util.links.*;
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
public class LinkInfoImpl extends LinkInfo {
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
     * Indicate that the link appears in a class list.
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
    public static final int ALL_CLASSES_FRAME = 1;
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
     * Indicate that the link appears in a class documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
    public static final int CONTEXT_CLASS = 2;
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
     * Indicate that the link appears in member documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
    public static final int CONTEXT_MEMBER = 3;
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
     * Indicate that the link appears in class use documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
    public static final int CONTEXT_CLASS_USE = 4;
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
     * Indicate that the link appears in index documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
    public static final int CONTEXT_INDEX = 5;
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
     * Indicate that the link appears in constant value summary.
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
    public static final int CONTEXT_CONSTANT_SUMMARY = 6;
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
     * Indicate that the link appears in serialized form documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
    public static final int CONTEXT_SERIALIZED_FORM = 7;
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
     * Indicate that the link appears in serial member documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
    public static final int CONTEXT_SERIAL_MEMBER = 8;
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
     * Indicate that the link appears in package documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
    public static final int CONTEXT_PACKAGE = 9;
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
     * Indicate that the link appears in see tag documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
    public static final int CONTEXT_SEE_TAG = 10;
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
     * Indicate that the link appears in value tag documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
    public static final int CONTEXT_VALUE_TAG = 11;
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
     * Indicate that the link appears in tree documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
    public static final int CONTEXT_TREE = 12;
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
     * Indicate that the link appears in a class list.
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
    public static final int PACKAGE_FRAME = 13;
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
     * The header in the class documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
    public static final int CONTEXT_CLASS_HEADER = 14;
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
     * The signature in the class documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
    public static final int CONTEXT_CLASS_SIGNATURE = 15;
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
     * The return type of a method.
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
    public static final int CONTEXT_RETURN_TYPE = 16;
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   116
     * The return type of a method in a member summary.
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
    public static final int CONTEXT_SUMMARY_RETURN_TYPE = 17;
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
     * The type of a method/constructor parameter.
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
    public static final int CONTEXT_EXECUTABLE_MEMBER_PARAM = 18;
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   126
     * Super interface links.
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
    public static final int CONTEXT_SUPER_INTERFACES = 19;
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
     * Implemented interface links.
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
    public static final int CONTEXT_IMPLEMENTED_INTERFACES = 20;
06bc494ca11e Initial load
duke
parents:
diff changeset
   134
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
     * Implemented class links.
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
    public static final int CONTEXT_IMPLEMENTED_CLASSES = 21;
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
     * Subinterface links.
06bc494ca11e Initial load
duke
parents:
diff changeset
   142
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
    public static final int CONTEXT_SUBINTERFACES = 22;
06bc494ca11e Initial load
duke
parents:
diff changeset
   144
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
     * Subclasses links.
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
    public static final int CONTEXT_SUBCLASSES = 23;
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
     * The signature in the class documentation (implements/extends portion).
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
    public static final int CONTEXT_CLASS_SIGNATURE_PARENT_NAME = 24;
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
06bc494ca11e Initial load
duke
parents:
diff changeset
   155
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   156
     * The header for method documentation copied from parent.
06bc494ca11e Initial load
duke
parents:
diff changeset
   157
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
    public static final int CONTEXT_METHOD_DOC_COPY = 26;
06bc494ca11e Initial load
duke
parents:
diff changeset
   159
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
     * Method "specified by" link.
06bc494ca11e Initial load
duke
parents:
diff changeset
   162
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   163
    public static final int CONTEXT_METHOD_SPECIFIED_BY = 27;
06bc494ca11e Initial load
duke
parents:
diff changeset
   164
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
     * Method "overrides" link.
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
    public static final int CONTEXT_METHOD_OVERRIDES = 28;
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
     * Annotation link.
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   173
    public static final int CONTEXT_ANNOTATION = 29;
06bc494ca11e Initial load
duke
parents:
diff changeset
   174
06bc494ca11e Initial load
duke
parents:
diff changeset
   175
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
     * The header for field documentation copied from parent.
06bc494ca11e Initial load
duke
parents:
diff changeset
   177
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   178
    public static final int CONTEXT_FIELD_DOC_COPY = 30;
06bc494ca11e Initial load
duke
parents:
diff changeset
   179
06bc494ca11e Initial load
duke
parents:
diff changeset
   180
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   181
     * The parent nodes int the class tree.
06bc494ca11e Initial load
duke
parents:
diff changeset
   182
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   183
    public static final int CONTEXT_CLASS_TREE_PARENT = 31;
06bc494ca11e Initial load
duke
parents:
diff changeset
   184
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   186
     * The type parameters of a method or constructor.
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   188
    public static final int CONTEXT_MEMBER_TYPE_PARAMS = 32;
06bc494ca11e Initial load
duke
parents:
diff changeset
   189
06bc494ca11e Initial load
duke
parents:
diff changeset
   190
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   191
     * Indicate that the link appears in class use documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
   192
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   193
    public static final int CONTEXT_CLASS_USE_HEADER = 33;
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   196
     * The integer indicating the location of the link.
06bc494ca11e Initial load
duke
parents:
diff changeset
   197
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
    public int context;
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
     * The value of the marker #.
06bc494ca11e Initial load
duke
parents:
diff changeset
   202
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   203
    public String where = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
   204
06bc494ca11e Initial load
duke
parents:
diff changeset
   205
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   206
     * String style of text defined in style sheet.
06bc494ca11e Initial load
duke
parents:
diff changeset
   207
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   208
    public String styleName ="";
06bc494ca11e Initial load
duke
parents:
diff changeset
   209
06bc494ca11e Initial load
duke
parents:
diff changeset
   210
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   211
     * The valueof the target.
06bc494ca11e Initial load
duke
parents:
diff changeset
   212
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   213
    public String target = "";
06bc494ca11e Initial load
duke
parents:
diff changeset
   214
06bc494ca11e Initial load
duke
parents:
diff changeset
   215
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   216
     * Construct a LinkInfo object.
06bc494ca11e Initial load
duke
parents:
diff changeset
   217
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   218
     * @param context    the context of the link.
06bc494ca11e Initial load
duke
parents:
diff changeset
   219
     * @param classDoc   the class to link to.
06bc494ca11e Initial load
duke
parents:
diff changeset
   220
     * @param label      the label for the link.
06bc494ca11e Initial load
duke
parents:
diff changeset
   221
     * @param target     the value of the target attribute.
06bc494ca11e Initial load
duke
parents:
diff changeset
   222
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   223
    public LinkInfoImpl (int context, ClassDoc classDoc, String label,
06bc494ca11e Initial load
duke
parents:
diff changeset
   224
            String target){
06bc494ca11e Initial load
duke
parents:
diff changeset
   225
        this.classDoc = classDoc;
06bc494ca11e Initial load
duke
parents:
diff changeset
   226
        this.label = label;
06bc494ca11e Initial load
duke
parents:
diff changeset
   227
        this.target = target;
06bc494ca11e Initial load
duke
parents:
diff changeset
   228
        setContext(context);
06bc494ca11e Initial load
duke
parents:
diff changeset
   229
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   230
06bc494ca11e Initial load
duke
parents:
diff changeset
   231
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   232
     * Construct a LinkInfo object.
06bc494ca11e Initial load
duke
parents:
diff changeset
   233
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   234
     * @param context    the context of the link.
06bc494ca11e Initial load
duke
parents:
diff changeset
   235
     * @param classDoc   the class to link to.
06bc494ca11e Initial load
duke
parents:
diff changeset
   236
     * @param where      the value of the marker #.
06bc494ca11e Initial load
duke
parents:
diff changeset
   237
     * @param label      the label for the link.
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   238
     * @param isStrong       true if the link should be strong.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   239
     * @param styleName  String style of text defined in style sheet.
06bc494ca11e Initial load
duke
parents:
diff changeset
   240
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   241
    public LinkInfoImpl (int context, ClassDoc classDoc, String where, String label,
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   242
            boolean isStrong, String styleName){
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   243
        this.classDoc = classDoc;
06bc494ca11e Initial load
duke
parents:
diff changeset
   244
        this.where = where;
06bc494ca11e Initial load
duke
parents:
diff changeset
   245
        this.label = label;
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   246
        this.isStrong = isStrong;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   247
        this.styleName = styleName;
06bc494ca11e Initial load
duke
parents:
diff changeset
   248
        setContext(context);
06bc494ca11e Initial load
duke
parents:
diff changeset
   249
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   250
06bc494ca11e Initial load
duke
parents:
diff changeset
   251
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   252
     * Construct a LinkInfo object.
06bc494ca11e Initial load
duke
parents:
diff changeset
   253
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   254
     * @param context    the context of the link.
06bc494ca11e Initial load
duke
parents:
diff changeset
   255
     * @param classDoc   the class to link to.
06bc494ca11e Initial load
duke
parents:
diff changeset
   256
     * @param where      the value of the marker #.
06bc494ca11e Initial load
duke
parents:
diff changeset
   257
     * @param label      the label for the link.
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   258
     * @param isStrong       true if the link should be strong.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   259
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   260
    public LinkInfoImpl (int context, ClassDoc classDoc, String where, String label,
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   261
            boolean isStrong){
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
        this.classDoc = classDoc;
06bc494ca11e Initial load
duke
parents:
diff changeset
   263
        this.where = where;
06bc494ca11e Initial load
duke
parents:
diff changeset
   264
        this.label = label;
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   265
        this.isStrong = isStrong;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   266
        setContext(context);
06bc494ca11e Initial load
duke
parents:
diff changeset
   267
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   268
06bc494ca11e Initial load
duke
parents:
diff changeset
   269
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   270
     * Construct a LinkInfo object.
06bc494ca11e Initial load
duke
parents:
diff changeset
   271
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   272
     * @param classDoc   the class to link to.
06bc494ca11e Initial load
duke
parents:
diff changeset
   273
     * @param label      the label for the link.
06bc494ca11e Initial load
duke
parents:
diff changeset
   274
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   275
    public LinkInfoImpl (ClassDoc classDoc, String label){
06bc494ca11e Initial load
duke
parents:
diff changeset
   276
        this.classDoc = classDoc;
06bc494ca11e Initial load
duke
parents:
diff changeset
   277
        this.label = label;
06bc494ca11e Initial load
duke
parents:
diff changeset
   278
        setContext(context);
06bc494ca11e Initial load
duke
parents:
diff changeset
   279
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   280
06bc494ca11e Initial load
duke
parents:
diff changeset
   281
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   282
     * Construct a LinkInfo object.
06bc494ca11e Initial load
duke
parents:
diff changeset
   283
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   284
     * @param context               the context of the link.
06bc494ca11e Initial load
duke
parents:
diff changeset
   285
     * @param executableMemberDoc   the member to link to.
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   286
     * @param isStrong                true if the link should be strong.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   287
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   288
    public LinkInfoImpl (int context, ExecutableMemberDoc executableMemberDoc,
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   289
            boolean isStrong){
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   290
        this.executableMemberDoc = executableMemberDoc;
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   291
        this.isStrong = isStrong;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   292
        setContext(context);
06bc494ca11e Initial load
duke
parents:
diff changeset
   293
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   294
06bc494ca11e Initial load
duke
parents:
diff changeset
   295
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   296
     * Construct a LinkInfo object.
06bc494ca11e Initial load
duke
parents:
diff changeset
   297
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   298
     * @param context    the context of the link.
06bc494ca11e Initial load
duke
parents:
diff changeset
   299
     * @param classDoc   the class to link to.
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   300
     * @param isStrong       true if the link should be strong.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   301
     */
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   302
    public LinkInfoImpl (int context, ClassDoc classDoc,  boolean isStrong){
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   303
        this.classDoc = classDoc;
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   304
        this.isStrong = isStrong;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   305
        setContext(context);
06bc494ca11e Initial load
duke
parents:
diff changeset
   306
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   307
06bc494ca11e Initial load
duke
parents:
diff changeset
   308
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   309
     * Construct a LinkInfo object.
06bc494ca11e Initial load
duke
parents:
diff changeset
   310
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   311
     * @param context    the context of the link.
06bc494ca11e Initial load
duke
parents:
diff changeset
   312
     * @param type       the class to link to.
06bc494ca11e Initial load
duke
parents:
diff changeset
   313
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   314
    public LinkInfoImpl (int context, Type type){
06bc494ca11e Initial load
duke
parents:
diff changeset
   315
        this.type = type;
06bc494ca11e Initial load
duke
parents:
diff changeset
   316
        setContext(context);
06bc494ca11e Initial load
duke
parents:
diff changeset
   317
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   318
06bc494ca11e Initial load
duke
parents:
diff changeset
   319
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   320
     * Construct a LinkInfo object.
06bc494ca11e Initial load
duke
parents:
diff changeset
   321
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   322
     * @param context    the context of the link.
06bc494ca11e Initial load
duke
parents:
diff changeset
   323
     * @param type       the class to link to.
06bc494ca11e Initial load
duke
parents:
diff changeset
   324
     * @param isVarArg   true if this is a link to a var arg.
06bc494ca11e Initial load
duke
parents:
diff changeset
   325
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   326
    public LinkInfoImpl (int context, Type type, boolean isVarArg){
06bc494ca11e Initial load
duke
parents:
diff changeset
   327
        this.type = type;
06bc494ca11e Initial load
duke
parents:
diff changeset
   328
        this.isVarArg = isVarArg;
06bc494ca11e Initial load
duke
parents:
diff changeset
   329
        setContext(context);
06bc494ca11e Initial load
duke
parents:
diff changeset
   330
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   331
06bc494ca11e Initial load
duke
parents:
diff changeset
   332
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   333
     * Construct a LinkInfo object.
06bc494ca11e Initial load
duke
parents:
diff changeset
   334
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   335
     * @param context    the context of the link.
06bc494ca11e Initial load
duke
parents:
diff changeset
   336
     * @param type       the class to link to.
06bc494ca11e Initial load
duke
parents:
diff changeset
   337
     * @param label      the label for the link.
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   338
     * @param isStrong     true if the link should be strong.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   339
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   340
    public LinkInfoImpl (int context, Type type, String label,
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   341
            boolean isStrong){
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   342
        this.type = type;
06bc494ca11e Initial load
duke
parents:
diff changeset
   343
        this.label = label;
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   344
        this.isStrong = isStrong;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   345
        setContext(context);
06bc494ca11e Initial load
duke
parents:
diff changeset
   346
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   347
06bc494ca11e Initial load
duke
parents:
diff changeset
   348
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   349
     * Construct a LinkInfo object.
06bc494ca11e Initial load
duke
parents:
diff changeset
   350
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   351
     * @param context    the context of the link.
06bc494ca11e Initial load
duke
parents:
diff changeset
   352
     * @param classDoc   the class to link to.
06bc494ca11e Initial load
duke
parents:
diff changeset
   353
     * @param label      the label for the link.
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   354
     * @param isStrong       true if the link should be strong.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   355
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   356
    public LinkInfoImpl (int context, ClassDoc classDoc, String label,
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   357
            boolean isStrong){
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   358
        this.classDoc = classDoc;
06bc494ca11e Initial load
duke
parents:
diff changeset
   359
        this.label = label;
1787
1aa079321cd2 6786028: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - Bold tags should be strong
bpatel
parents: 10
diff changeset
   360
        this.isStrong = isStrong;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   361
        setContext(context);
06bc494ca11e Initial load
duke
parents:
diff changeset
   362
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   363
06bc494ca11e Initial load
duke
parents:
diff changeset
   364
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   365
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   366
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   367
    public int getContext() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   368
        return context;
06bc494ca11e Initial load
duke
parents:
diff changeset
   369
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   370
06bc494ca11e Initial load
duke
parents:
diff changeset
   371
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   372
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   373
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   374
     * This method sets the link attributes to the appropriate values
06bc494ca11e Initial load
duke
parents:
diff changeset
   375
     * based on the context.
06bc494ca11e Initial load
duke
parents:
diff changeset
   376
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   377
     * @param c the context id to set.
06bc494ca11e Initial load
duke
parents:
diff changeset
   378
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   379
    public void setContext(int c) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   380
        //NOTE:  Put context specific link code here.
06bc494ca11e Initial load
duke
parents:
diff changeset
   381
        switch (c) {
06bc494ca11e Initial load
duke
parents:
diff changeset
   382
            case ALL_CLASSES_FRAME:
06bc494ca11e Initial load
duke
parents:
diff changeset
   383
            case PACKAGE_FRAME:
06bc494ca11e Initial load
duke
parents:
diff changeset
   384
            case CONTEXT_IMPLEMENTED_CLASSES:
06bc494ca11e Initial load
duke
parents:
diff changeset
   385
            case CONTEXT_SUBCLASSES:
06bc494ca11e Initial load
duke
parents:
diff changeset
   386
            case CONTEXT_METHOD_DOC_COPY:
06bc494ca11e Initial load
duke
parents:
diff changeset
   387
            case CONTEXT_FIELD_DOC_COPY:
06bc494ca11e Initial load
duke
parents:
diff changeset
   388
            case CONTEXT_CLASS_USE_HEADER:
06bc494ca11e Initial load
duke
parents:
diff changeset
   389
                includeTypeInClassLinkLabel = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   390
                break;
06bc494ca11e Initial load
duke
parents:
diff changeset
   391
06bc494ca11e Initial load
duke
parents:
diff changeset
   392
            case CONTEXT_ANNOTATION:
06bc494ca11e Initial load
duke
parents:
diff changeset
   393
                excludeTypeParameterLinks = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   394
                excludeTypeBounds = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   395
                break;
06bc494ca11e Initial load
duke
parents:
diff changeset
   396
06bc494ca11e Initial load
duke
parents:
diff changeset
   397
            case CONTEXT_IMPLEMENTED_INTERFACES:
06bc494ca11e Initial load
duke
parents:
diff changeset
   398
            case CONTEXT_SUPER_INTERFACES:
06bc494ca11e Initial load
duke
parents:
diff changeset
   399
            case CONTEXT_SUBINTERFACES:
06bc494ca11e Initial load
duke
parents:
diff changeset
   400
            case CONTEXT_CLASS_TREE_PARENT:
06bc494ca11e Initial load
duke
parents:
diff changeset
   401
            case CONTEXT_TREE:
06bc494ca11e Initial load
duke
parents:
diff changeset
   402
            case CONTEXT_CLASS_SIGNATURE_PARENT_NAME:
06bc494ca11e Initial load
duke
parents:
diff changeset
   403
                excludeTypeParameterLinks = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   404
                excludeTypeBounds = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   405
                includeTypeInClassLinkLabel = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   406
                includeTypeAsSepLink = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   407
                break;
06bc494ca11e Initial load
duke
parents:
diff changeset
   408
06bc494ca11e Initial load
duke
parents:
diff changeset
   409
            case CONTEXT_PACKAGE:
06bc494ca11e Initial load
duke
parents:
diff changeset
   410
            case CONTEXT_CLASS_USE:
06bc494ca11e Initial load
duke
parents:
diff changeset
   411
                excludeTypeBoundsLinks = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   412
                excludeTypeParameterLinks = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   413
                break;
06bc494ca11e Initial load
duke
parents:
diff changeset
   414
06bc494ca11e Initial load
duke
parents:
diff changeset
   415
            case CONTEXT_CLASS_HEADER:
06bc494ca11e Initial load
duke
parents:
diff changeset
   416
            case CONTEXT_CLASS_SIGNATURE:
06bc494ca11e Initial load
duke
parents:
diff changeset
   417
                excludeTypeParameterLinks = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   418
                includeTypeAsSepLink = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   419
                includeTypeInClassLinkLabel = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   420
                break;
06bc494ca11e Initial load
duke
parents:
diff changeset
   421
06bc494ca11e Initial load
duke
parents:
diff changeset
   422
            case CONTEXT_MEMBER_TYPE_PARAMS:
06bc494ca11e Initial load
duke
parents:
diff changeset
   423
                includeTypeAsSepLink = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   424
                includeTypeInClassLinkLabel = false;
06bc494ca11e Initial load
duke
parents:
diff changeset
   425
                break;
06bc494ca11e Initial load
duke
parents:
diff changeset
   426
06bc494ca11e Initial load
duke
parents:
diff changeset
   427
            case CONTEXT_RETURN_TYPE:
06bc494ca11e Initial load
duke
parents:
diff changeset
   428
            case CONTEXT_SUMMARY_RETURN_TYPE:
06bc494ca11e Initial load
duke
parents:
diff changeset
   429
            case CONTEXT_EXECUTABLE_MEMBER_PARAM:
06bc494ca11e Initial load
duke
parents:
diff changeset
   430
                excludeTypeBounds = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   431
                break;
06bc494ca11e Initial load
duke
parents:
diff changeset
   432
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   433
        context = c;
06bc494ca11e Initial load
duke
parents:
diff changeset
   434
        if (type != null &&
06bc494ca11e Initial load
duke
parents:
diff changeset
   435
            type.asTypeVariable()!= null &&
06bc494ca11e Initial load
duke
parents:
diff changeset
   436
            type.asTypeVariable().owner() instanceof ExecutableMemberDoc){
06bc494ca11e Initial load
duke
parents:
diff changeset
   437
            excludeTypeParameterLinks = true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   438
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   439
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   440
06bc494ca11e Initial load
duke
parents:
diff changeset
   441
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   442
     * Return true if this link is linkable and false if we can't link to the
06bc494ca11e Initial load
duke
parents:
diff changeset
   443
     * desired place.
06bc494ca11e Initial load
duke
parents:
diff changeset
   444
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   445
     * @return true if this link is linkable and false if we can't link to the
06bc494ca11e Initial load
duke
parents:
diff changeset
   446
     * desired place.
06bc494ca11e Initial load
duke
parents:
diff changeset
   447
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   448
    public boolean isLinkable() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   449
        return Util.isLinkable(classDoc, ConfigurationImpl.getInstance());
06bc494ca11e Initial load
duke
parents:
diff changeset
   450
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   451
}