001 /* 002 * Copyright 1998-2002 Sun Microsystems, Inc. All Rights Reserved. 003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 004 * 005 * This code is free software; you can redistribute it and/or modify it 006 * under the terms of the GNU General Public License version 2 only, as 007 * published by the Free Software Foundation. Sun designates this 008 * particular file as subject to the "Classpath" exception as provided 009 * by Sun in the LICENSE file that accompanied this code. 010 * 011 * This code is distributed in the hope that it will be useful, but WITHOUT 012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 013 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 014 * version 2 for more details (a copy is included in the LICENSE file that 015 * accompanied this code). 016 * 017 * You should have received a copy of the GNU General Public License version 018 * 2 along with this work; if not, write to the Free Software Foundation, 019 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 020 * 021 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 022 * CA 95054 USA or visit www.sun.com if you need additional information or 023 * have any questions. 024 */ 025 026 package com.sun.javadoc; 027 028 /** 029 * Represents a user-defined cross-reference to related documentation. 030 * The tag can reference a package, class or member, or can hold 031 * plain text. (The plain text might be a reference 032 * to something not online, such as a printed book, or be a hard-coded 033 * HTML link.) The reference can either be inline with the comment, 034 * using <code>{@link}</code>, or a separate block comment, 035 * using <code>@see</code>. 036 * Method <code>name()</code> returns "@link" (no curly braces) or 037 * "@see", depending on the tag. 038 * Method <code>kind()</code> returns "@see" for both tags. 039 * 040 * @author Kaiyang Liu (original) 041 * @author Robert Field (rewrite) 042 * @author Atul M Dambalkar 043 * 044 */ 045 public interface SeeTag extends Tag { 046 047 /** 048 * Get the label of the <code>@see</code> tag. 049 * Return null if no label is present. 050 * For example, for: 051 * <p> 052 * <code>@see String#trim() the trim method</code> 053 * </p> 054 * return "the trim method". 055 */ 056 String label(); 057 058 /** 059 * Get the package doc when <code>@see</code> references only a package. 060 * Return null if the package cannot be found, or if 061 * <code>@see</code> references any other element (class, 062 * interface, field, constructor, method) or non-element. 063 * For example, for: 064 * <p> 065 * <code>@see java.lang</code> 066 * </p> 067 * return the <code>PackageDoc</code> for <code>java.lang</code>. 068 */ 069 public PackageDoc referencedPackage(); 070 071 /** 072 * Get the class or interface name of the <code>@see</code> reference. 073 * The name is fully qualified if the name specified in the 074 * original <code>@see</code> tag was fully qualified, or if the class 075 * or interface can be found; otherwise it is unqualified. 076 * If <code>@see</code> references only a package name, then return 077 * the package name instead. 078 * For example, for: 079 * <p> 080 * <code>@see String#valueOf(java.lang.Object)</code> 081 * </p> 082 * return "java.lang.String". 083 * For "<code>@see java.lang</code>", return "java.lang". 084 * Return null if <code>@see</code> references a non-element, such as 085 * <code>@see <a href="java.sun.com"></code>. 086 */ 087 String referencedClassName(); 088 089 /** 090 * Get the class doc referenced by the class name part of @see. 091 * Return null if the class cannot be found. 092 * For example, for: 093 * <p> 094 * <code>@see String#valueOf(java.lang.Object)</code> 095 * </p> 096 * return the <code>ClassDoc</code> for <code>java.lang.String</code>. 097 */ 098 ClassDoc referencedClass(); 099 100 /** 101 * Get the field, constructor or method substring of the <code>@see</code> 102 * reference. Return null if the reference is to any other 103 * element or to any non-element. 104 * References to member classes (nested classes) return null. 105 * For example, for: 106 * <p> 107 * <code>@see String#startsWith(String)</code> 108 * </p> 109 * return "startsWith(String)". 110 */ 111 String referencedMemberName(); 112 113 /** 114 * Get the member doc for the field, constructor or method 115 * referenced by <code>@see</code>. Return null if the member cannot 116 * be found or if the reference is to any other element or to any 117 * non-element. 118 * References to member classes (nested classes) return null. 119 * For example, for: 120 * <p> 121 * <code>@see String#startsWith(java.lang.String)</code> 122 * </p> 123 * return the <code>MethodDoc</code> for <code>startsWith</code>. 124 */ 125 MemberDoc referencedMember(); 126 }