1. /*
  2. * @(#)SeeTag.java 1.9 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package com.sun.javadoc;
  8. /**
  9. * Represents a user-defined cross-reference to related documentation.
  10. * The tag can reference a package, class or member, or can hold
  11. * plain text. (The plain text might be a reference
  12. * to something not online, such as a printed book, or be a hard-coded
  13. * HTML link.) The reference can either be inline with the comment,
  14. * using <code>{@link}</code>, or a separate block comment,
  15. * using <code>@see</code>.
  16. * Method <code>name()</code> returns "@link" (no curly braces) or
  17. * "@see", depending on the tag.
  18. * Method <code>kind()</code> returns "@see" for both tags.
  19. *
  20. * @version 06/10/97
  21. * @author Kaiyang Liu (original)
  22. * @author Robert Field (rewrite)
  23. * @author Atul M Dambalkar
  24. *
  25. */
  26. public interface SeeTag extends Tag {
  27. /**
  28. * Get the label of the <code>@see</code> tag.
  29. * Return null if no label is present.
  30. * For example, for:
  31. * <p>
  32. *   <code>@see String#trim() the trim method</code>
  33. * </p>
  34. * return "the trim method".
  35. */
  36. String label();
  37. /**
  38. * Get the package doc when <code>@see</code> references only a package.
  39. * Return null if the package cannot be found, or if
  40. * <code>@see</code> references any other element (class,
  41. * interface, field, constructor, method) or non-element.
  42. * For example, for:
  43. * <p>
  44. *   <code>@see java.lang</code>
  45. * </p>
  46. * return the <code>PackageDoc</code> for <code>java.lang</code>.
  47. */
  48. public PackageDoc referencedPackage();
  49. /**
  50. * Get the class or interface name of the <code>@see</code> reference.
  51. * The name is fully qualified if the name specified in the
  52. * original <code>@see</code> tag was fully qualified, or if the class
  53. * or interface can be found; otherwise it is unqualified.
  54. * If <code>@see</code> references only a package name, then return
  55. * the package name instead.
  56. * For example, for:
  57. * <p>
  58. *   <code>@see String#valueOf(java.lang.Object)</code>
  59. * </p>
  60. * return "java.lang.String".
  61. * For "<code>@see java.lang</code>", return "java.lang".
  62. * Return null if <code>@see</code> references a non-element, such as
  63. * <code>@see <a href="java.sun.com"></code>.
  64. */
  65. String referencedClassName();
  66. /**
  67. * Get the class doc referenced by the class name part of @see.
  68. * Return null if the class cannot be found.
  69. * For example, for:
  70. * <p>
  71. *   <code>@see String#valueOf(java.lang.Object)</code>
  72. * </p>
  73. * return the <code>ClassDoc</code> for <code>java.lang.String</code>.
  74. */
  75. ClassDoc referencedClass();
  76. /**
  77. * Get the field, constructor or method substring of the <code>@see</code>
  78. * reference. Return null if the reference is to any other
  79. * element or to any non-element.
  80. * References to member classes (nested classes) return null.
  81. * For example, for:
  82. * <p>
  83. *   <code>@see String#startsWith(String)</code>
  84. * </p>
  85. * return "startsWith(String)".
  86. */
  87. String referencedMemberName();
  88. /**
  89. * Get the member doc for the field, constructor or method
  90. * referenced by <code>@see</code>. Return null if the member cannot
  91. * be found or if the reference is to any other element or to any
  92. * non-element.
  93. * References to member classes (nested classes) return null.
  94. * For example, for:
  95. * <p>
  96. *   <code>@see String#startsWith(java.lang.String)</code>
  97. * </p>
  98. * return the <code>MethodDoc</code> for <code>startsWith</code>.
  99. */
  100. MemberDoc referencedMember();
  101. }