langtools/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/ValueTaglet.java
author ksrini
Sat, 28 Nov 2015 18:52:17 -0800
changeset 35426 374342e56a56
parent 25874 langtools/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ValueTaglet.java@83c19f00452c
child 38911 48a00b5ee366
permissions -rw-r--r--
8035473: [javadoc] Revamp the existing Doclet APIs 8146529: Update the new Doclet API 8146427: "-nohelp" option issue 8146475: "-helpfile" option issue Reviewed-by: alanb, bpatel, ihse, jjg, jlahoda, mchung, ogb, vromero
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
     2
 * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
    23
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    26
package jdk.javadoc.internal.doclets.toolkit.taglets;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    27
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    29
import javax.lang.model.element.Element;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    30
import javax.lang.model.element.TypeElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    31
import javax.lang.model.element.VariableElement;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    32
import javax.lang.model.util.Elements;
14258
8d2148961366 8000663: clean up langtools imports
jjg
parents: 5520
diff changeset
    33
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    34
import com.sun.source.doctree.DocTree;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    35
import jdk.javadoc.internal.doclets.toolkit.Configuration;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    36
import jdk.javadoc.internal.doclets.toolkit.Content;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    37
import jdk.javadoc.internal.doclets.toolkit.util.CommentHelper;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    38
import jdk.javadoc.internal.doclets.toolkit.util.Utils;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    39
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    40
import static com.sun.source.doctree.DocTree.Kind.*;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
 * An inline Taglet representing the value tag. This tag should only be used with
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
 * constant fields that have a value.  It is used to access the value of constant
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
 * fields.  This inline tag has an optional field name parameter.  If the name is
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
 * specified, the constant value is retrieved from the specified field.  A link
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
 * is also created to the specified field.  If a name is not specified, the value
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
 * is retrieved for the field that the inline tag appears on.  The name is specifed
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
 * in the following format:  [fully qualified class name]#[constant field name].
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
 *
14260
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14259
diff changeset
    51
 *  <p><b>This is NOT part of any supported API.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14259
diff changeset
    52
 *  If you write code that depends on this, you do so at your own risk.
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14259
diff changeset
    53
 *  This code and its internal interfaces are subject to change or
727a84636f12 8000665: fix "internal API" comments on javadoc files
jjg
parents: 14259
diff changeset
    54
 *  deletion without notice.</b>
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
 * @author Jamie Ho
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
public class ValueTaglet extends BaseInlineTaglet {
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
     * Construct a new ValueTaglet.
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
    public ValueTaglet() {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
    65
        name = VALUE.tagName;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
     * Will return false because this inline tag may
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
     * only appear in Fields.
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
     * @return false since this is not a method.
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
    public boolean inMethod() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
        return true;
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
     * Will return false because this inline tag may
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
     * only appear in Fields.
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
     * @return false since this is not a method.
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
    public boolean inConstructor() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
        return true;
06bc494ca11e Initial load
duke
parents:
diff changeset
    84
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    87
     * Will return false because this inline tag may
06bc494ca11e Initial load
duke
parents:
diff changeset
    88
     * only appear in Fields.
06bc494ca11e Initial load
duke
parents:
diff changeset
    89
     * @return false since this is not a method.
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
    public boolean inOverview() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
        return true;
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
     * Will return false because this inline tag may
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
     * only appear in Fields.
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
     * @return false since this is not a method.
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
    public boolean inPackage() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   101
        return true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   103
06bc494ca11e Initial load
duke
parents:
diff changeset
   104
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   105
     * Will return false because this inline tag may
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
     * only appear in Fields.
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
     * @return false since this is not a method.
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
    public boolean inType() {
06bc494ca11e Initial load
duke
parents:
diff changeset
   110
        return true;
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
    /**
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   114
     * Given the name of the field, return the corresponding VariableElement. Return null
20264
f7527e6828bb 8004825: javadoc crash DocletAbortException
bpatel
parents: 19667
diff changeset
   115
     * due to invalid use of value tag if the name is null or empty string and if
f7527e6828bb 8004825: javadoc crash DocletAbortException
bpatel
parents: 19667
diff changeset
   116
     * the value tag is not used on a field.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
     *
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   118
     * @param holder the element holding the tag
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   119
     * @param config the current configuration of the doclet.
06bc494ca11e Initial load
duke
parents:
diff changeset
   120
     * @param tag the value tag.
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
     *
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   122
     * @return the corresponding VariableElement. If the name is null or empty string,
20264
f7527e6828bb 8004825: javadoc crash DocletAbortException
bpatel
parents: 19667
diff changeset
   123
     * return field that the value tag was used in. Return null if the name is null
f7527e6828bb 8004825: javadoc crash DocletAbortException
bpatel
parents: 19667
diff changeset
   124
     * or empty string and if the value tag is not used on a field.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   126
    private VariableElement getVariableElement(Element holder, Configuration config, DocTree tag) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   127
        Utils utils = config.utils;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   128
        CommentHelper ch = utils.getCommentHelper(holder);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   129
        String signature = ch.getReferencedSignature(tag);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   130
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   131
        if (signature == null) { // no reference
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
            //Base case: no label.
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   133
            if (utils.isVariableElement(holder)) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   134
                return (VariableElement)(holder);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
            } else {
20264
f7527e6828bb 8004825: javadoc crash DocletAbortException
bpatel
parents: 19667
diff changeset
   136
                // If the value tag does not specify a parameter which is a valid field and
f7527e6828bb 8004825: javadoc crash DocletAbortException
bpatel
parents: 19667
diff changeset
   137
                // it is not used within the comments of a valid field, return null.
f7527e6828bb 8004825: javadoc crash DocletAbortException
bpatel
parents: 19667
diff changeset
   138
                 return null;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
        }
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   141
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   142
        String[] sigValues = signature.split("#");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   143
        String memberName = null;
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   144
        TypeElement te = null;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   145
        if (sigValues.length == 1) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
            //Case 2:  @value in same class.
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   147
            if (utils.isExecutableElement(holder) || utils.isVariableElement(holder)) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   148
                te = utils.getEnclosingTypeElement(holder);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   149
            } else if (utils.isTypeElement(holder)) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   150
                te = utils.getTopMostContainingTypeElement(holder);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
            }
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   152
            memberName = sigValues[0];
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   153
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   154
            //Case 3: @value in different class.
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   155
            Elements elements = config.root.getElementUtils();
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   156
            te = elements.getTypeElement(sigValues[0]);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   157
            memberName = sigValues[1];
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   158
        }
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   159
        if (te == null) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   160
            return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   161
        }
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   162
        for (Element field : utils.getFields(te)) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   163
            if (utils.getSimpleName(field).equals(memberName)) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   164
                return (VariableElement)field;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   165
            }
06bc494ca11e Initial load
duke
parents:
diff changeset
   166
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   167
        return null;
06bc494ca11e Initial load
duke
parents:
diff changeset
   168
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   169
06bc494ca11e Initial load
duke
parents:
diff changeset
   170
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   171
     * {@inheritDoc}
06bc494ca11e Initial load
duke
parents:
diff changeset
   172
     */
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   173
    public Content getTagletOutput(Element holder, DocTree tag, TagletWriter writer) {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   174
        Utils utils = writer.configuration().utils;
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   175
        VariableElement field = getVariableElement(holder, writer.configuration(), tag);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   176
        if (field == null) {
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   177
            if (tag.toString().isEmpty()) {
20264
f7527e6828bb 8004825: javadoc crash DocletAbortException
bpatel
parents: 19667
diff changeset
   178
                //Invalid use of @value
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   179
                writer.getMsgRetriever().warning(holder,
20264
f7527e6828bb 8004825: javadoc crash DocletAbortException
bpatel
parents: 19667
diff changeset
   180
                        "doclet.value_tag_invalid_use");
f7527e6828bb 8004825: javadoc crash DocletAbortException
bpatel
parents: 19667
diff changeset
   181
            } else {
f7527e6828bb 8004825: javadoc crash DocletAbortException
bpatel
parents: 19667
diff changeset
   182
                //Reference is unknown.
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   183
                writer.getMsgRetriever().warning(holder,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   184
                        "doclet.value_tag_invalid_reference", tag.toString());
20264
f7527e6828bb 8004825: javadoc crash DocletAbortException
bpatel
parents: 19667
diff changeset
   185
            }
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   186
        } else if (field.getConstantValue() != null) {
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   187
            return writer.valueTagOutput(field,
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   188
                utils.constantValueExpresion(field),
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   189
                // TODO: investigate and cleanup
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   190
                // in the j.l.m world, equals will not be accurate
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   191
                // !field.equals(tag.holder())
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   192
                !utils.elementsEqual(field, holder)
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   193
            );
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   194
        } else {
06bc494ca11e Initial load
duke
parents:
diff changeset
   195
            //Referenced field is not a constant.
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   196
            writer.getMsgRetriever().warning(holder,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 25874
diff changeset
   197
                "doclet.value_tag_invalid_constant", utils.getSimpleName(field));
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   198
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
        return writer.getOutputInstance();
06bc494ca11e Initial load
duke
parents:
diff changeset
   200
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
   201
}