langtools/src/share/classes/com/sun/javadoc/SeeTag.java
author jjg
Mon, 03 Mar 2014 15:10:01 -0800
changeset 23136 aa8958a4c8f4
parent 5520 86e4b9a9da40
child 23137 209daac13c8b
permissions -rw-r--r--
8035877: javadoc classes are missing @return and @param tags Reviewed-by: jjg Contributed-by: neil.toda@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
     2
 * Copyright (c) 1998, 2014, 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
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
package com.sun.javadoc;
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
 * Represents a user-defined cross-reference to related documentation.
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
 * The tag can reference a package, class or member, or can hold
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
 * plain text.  (The plain text might be a reference
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
 * to something not online, such as a printed book, or be a hard-coded
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
 * HTML link.)  The reference can either be inline with the comment,
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    34
 * using {@code {@link}}, or a separate block comment,
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    35
 * using {@code @see}.
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    36
 * Method {@code name()} returns "@link" (no curly braces) or
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 * "@see", depending on the tag.
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    38
 * Method {@code kind()} returns "@see" for both tags.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
 * @author Kaiyang Liu (original)
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 * @author Robert Field (rewrite)
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 * @author Atul M Dambalkar
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
public interface SeeTag extends Tag {
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
    /**
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    48
     * Get the label of the {@code @see} tag.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
     * Return null if no label is present.
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
     * For example, for:
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
     * <p>
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    52
     *    &nbsp;&nbsp;{@code @see String#trim() the trim method}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
     * </p>
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
     * return "the trim method".
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    55
     *
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    56
     * @return "the trim method".
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
    String label();
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
    /**
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    61
     * Get the package doc when {@code @see} references only a package.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
     * Return null if the package cannot be found, or if
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    63
     * {@code @see} references any other element (class,
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
     * interface, field, constructor, method) or non-element.
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
     * For example, for:
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
     * <p>
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    67
     *   &nbsp;&nbsp;{@code @see java.lang}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
     * </p>
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    69
     * return the {@code PackageDoc} for {@code java.lang}.
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    70
     *
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    71
     * @return the {@code PackageDoc} for {@code java.lang}.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
    public PackageDoc referencedPackage();
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
    /**
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    76
     * Get the class or interface name of the {@code @see} reference.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
     * The name is fully qualified if the name specified in the
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    78
     * original {@code @see} tag was fully qualified, or if the class
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    79
     * or interface can be found; otherwise it is unqualified.
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    80
     * If {@code @see} references only a package name, then return
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
     * the package name instead.
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
     * For example, for:
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
     * <p>
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    84
     *   &nbsp;&nbsp;{@code @see String#valueOf(java.lang.Object)}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
     * </p>
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
     * return "java.lang.String".
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    87
     * For "{@code @see java.lang}", return "java.lang".
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    88
     * Return null if {@code @see} references a non-element, such as
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    89
     * {@code @see &lt;a href="java.sun.com"&gt;}.
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    90
     *
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    91
     * @return null if {@code @see} references a non-element, such as
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
    92
     * {@code @see &lt;a href="java.sun.com"&gt;}.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
    String referencedClassName();
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
     * Get the class doc referenced by the class name part of @see.
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
     * Return null if the class cannot be found.
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
     * For example, for:
06bc494ca11e Initial load
duke
parents:
diff changeset
   100
     * <p>
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
   101
     *   &nbsp;&nbsp;{@code @see String#valueOf(java.lang.Object)}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   102
     * </p>
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
   103
     * return the {@code ClassDoc} for {@code java.lang.String}.
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
   104
     *
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
   105
     * @return the {@code ClassDoc} for {@code java.lang.String}.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   106
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   107
    ClassDoc referencedClass();
06bc494ca11e Initial load
duke
parents:
diff changeset
   108
06bc494ca11e Initial load
duke
parents:
diff changeset
   109
    /**
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
   110
     * Get the field, constructor or method substring of the {@code @see}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   111
     * reference. Return null if the reference is to any other
06bc494ca11e Initial load
duke
parents:
diff changeset
   112
     * element or to any non-element.
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
     * References to member classes (nested classes) return null.
06bc494ca11e Initial load
duke
parents:
diff changeset
   114
     * For example, for:
06bc494ca11e Initial load
duke
parents:
diff changeset
   115
     * <p>
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
   116
     *   &nbsp;&nbsp;{@code @see String#startsWith(String)}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   117
     * </p>
06bc494ca11e Initial load
duke
parents:
diff changeset
   118
     * return "startsWith(String)".
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
   119
     *
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
   120
     * @return "startsWith(String)".
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   121
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   122
    String referencedMemberName();
06bc494ca11e Initial load
duke
parents:
diff changeset
   123
06bc494ca11e Initial load
duke
parents:
diff changeset
   124
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
   125
     * Get the member doc for the field, constructor or method
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
   126
     * referenced by {@code @see}. Return null if the member cannot
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   127
     * be found or if the reference is to any other element or to any
06bc494ca11e Initial load
duke
parents:
diff changeset
   128
     * non-element.
06bc494ca11e Initial load
duke
parents:
diff changeset
   129
     * References to member classes (nested classes) return null.
06bc494ca11e Initial load
duke
parents:
diff changeset
   130
     * For example, for:
06bc494ca11e Initial load
duke
parents:
diff changeset
   131
     * <p>
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
   132
     *   &nbsp;&nbsp;{@code @see String#startsWith(java.lang.String)}
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
     * </p>
23136
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
   134
     * return the {@code MethodDoc} for {@code startsWith}.
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
   135
     *
aa8958a4c8f4 8035877: javadoc classes are missing @return and @param tags
jjg
parents: 5520
diff changeset
   136
     * @return the {@code MethodDoc} for {@code startsWith}.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
    MemberDoc referencedMember();
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
}