• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
7  * published by the Free Software Foundation.  Oracle designates this
8  * particular file as subject to the "Classpath" exception as provided
9  * by Oracle in the LICENSE file that accompanied this code.
10  *
11  * This code is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14  * version 2 for more details (a copy is included in the LICENSE file that
15  * accompanied this code).
16  *
17  * You should have received a copy of the GNU General Public License version
18  * 2 along with this work; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22  * or visit www.oracle.com if you need additional information or have any
23  * questions.
24  */
25 
26 package com.sun.javadoc;
27 
28 import com.google.doclava.annotation.Unused;
29 
30 /**
31  * Represents a user-defined cross-reference to related documentation.
32  * The tag can reference a package, class or member, or can hold
33  * plain text.  (The plain text might be a reference
34  * to something not online, such as a printed book, or be a hard-coded
35  * HTML link.)  The reference can either be inline with the comment,
36  * using <code>&#123;@link}</code>, or a separate block comment,
37  * using <code>@see</code>.
38  * Method <code>name()</code> returns "@link" (no curly braces) or
39  * "@see", depending on the tag.
40  * Method <code>kind()</code> returns "@see" for both tags.
41  *
42  * @author Kaiyang Liu (original)
43  * @author Robert Field (rewrite)
44  * @author Atul M Dambalkar
45  *
46  */
47 public interface SeeTag extends Tag {
48 
49     /**
50      * Get the label of the <code>@see</code> tag.
51      * Return null if no label is present.
52      * For example, for:
53      * <p>
54      *    &nbsp;&nbsp;<code>@see String#trim() the trim method</code>
55      * </p>
56      * return "the trim method".
57      */
58     @Unused
label()59     String label();
60 
61     /**
62      * Get the package doc when <code>@see</code> references only a package.
63      * Return null if the package cannot be found, or if
64      * <code>@see</code> references any other element (class,
65      * interface, field, constructor, method) or non-element.
66      * For example, for:
67      * <p>
68      *   &nbsp;&nbsp;<code>@see java.lang</code>
69      * </p>
70      * return the <code>PackageDoc</code> for <code>java.lang</code>.
71      */
72     @Unused
referencedPackage()73     PackageDoc referencedPackage();
74 
75     /**
76      * Get the class or interface name of the <code>@see</code> reference.
77      * The name is fully qualified if the name specified in the
78      * original <code>@see</code> tag was fully qualified, or if the class
79      * or interface can be found; otherwise it is unqualified.
80      * If <code>@see</code> references only a package name, then return
81      * the package name instead.
82      * For example, for:
83      * <p>
84      *   &nbsp;&nbsp;<code>@see String#valueOf(java.lang.Object)</code>
85      * </p>
86      * return "java.lang.String".
87      * For "<code>@see java.lang</code>", return "java.lang".
88      * Return null if <code>@see</code> references a non-element, such as
89      * <code>@see &lt;a href="java.sun.com"&gt;</code>.
90      */
91     @Unused
referencedClassName()92     String referencedClassName();
93 
94     /**
95      * Get the class doc referenced by the class name part of @see.
96      * Return null if the class cannot be found.
97      * For example, for:
98      * <p>
99      *   &nbsp;&nbsp;<code>@see String#valueOf(java.lang.Object)</code>
100      * </p>
101      * return the <code>ClassDoc</code> for <code>java.lang.String</code>.
102      */
103     @Unused
referencedClass()104     ClassDoc referencedClass();
105 
106     /**
107      * Get the field, constructor or method substring of the <code>@see</code>
108      * reference. Return null if the reference is to any other
109      * element or to any non-element.
110      * References to member classes (nested classes) return null.
111      * For example, for:
112      * <p>
113      *   &nbsp;&nbsp;<code>@see String#startsWith(String)</code>
114      * </p>
115      * return "startsWith(String)".
116      */
117     @Unused
referencedMemberName()118     String referencedMemberName();
119 
120     /**
121      * Get the member doc for the field, constructor or method
122      * referenced by <code>@see</code>. Return null if the member cannot
123      * be found or if the reference is to any other element or to any
124      * non-element.
125      * References to member classes (nested classes) return null.
126      * For example, for:
127      * <p>
128      *   &nbsp;&nbsp;<code>@see String#startsWith(java.lang.String)</code>
129      * </p>
130      * return the <code>MethodDoc</code> for <code>startsWith</code>.
131      */
132     @Unused
referencedMember()133     MemberDoc referencedMember();
134 }
135