1. /*
  2. * @(#)ProgramElementDoc.java 1.8 02/10/04
  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 java program element: class, interface, field,
  10. * constructor, or method.
  11. * This is an abstract class dealing with information common to
  12. * these elements.
  13. *
  14. * @see MemberDoc
  15. * @see ClassDoc
  16. *
  17. * @author Robert Field
  18. */
  19. public interface ProgramElementDoc extends Doc {
  20. /**
  21. * Get the containing class or interface of this program element.
  22. *
  23. * @return a ClassDoc for this element's containing class or interface.
  24. * If this is a top-level class or interface, return null.
  25. */
  26. ClassDoc containingClass();
  27. /**
  28. * Get the package that this program element is contained in.
  29. *
  30. * @return a PackageDoc for this element containing package.
  31. * If in the unnamed package, this PackageDoc will have the
  32. * name "".
  33. */
  34. PackageDoc containingPackage();
  35. /**
  36. * Get the fully qualified name of this program element.
  37. * For example, for the class <code>java.util.Hashtable</code>,
  38. * return "java.util.Hashtable".
  39. * <p>
  40. * For the method <code>bar()</code> in class <code>Foo</code>
  41. * in the unnamed package, return "Foo.bar".
  42. * </pre>
  43. *
  44. * @return the qualified name of the program element as a String.
  45. */
  46. String qualifiedName();
  47. /**
  48. * Get the modifier specifier integer.
  49. *
  50. * @see java.lang.reflect.Modifier
  51. */
  52. int modifierSpecifier();
  53. /**
  54. * Get modifiers string.
  55. * For example, for:
  56. * <pre>
  57. * public abstract int foo() { ... }
  58. * </pre>
  59. * return "public abstract".
  60. * Annotations are not included.
  61. */
  62. String modifiers();
  63. /**
  64. * Get the annotations of this program element.
  65. * Return an empty array if there are none.
  66. *
  67. * @return the annotations of this program element.
  68. * @since 1.5
  69. */
  70. AnnotationDesc[] annotations();
  71. /**
  72. * Return true if this program element is public.
  73. */
  74. boolean isPublic();
  75. /**
  76. * Return true if this program element is protected.
  77. */
  78. boolean isProtected();
  79. /**
  80. * Return true if this program element is private.
  81. */
  82. boolean isPrivate();
  83. /**
  84. * Return true if this program element is package private.
  85. */
  86. boolean isPackagePrivate();
  87. /**
  88. * Return true if this program element is static.
  89. */
  90. boolean isStatic();
  91. /**
  92. * Return true if this program element is final.
  93. */
  94. boolean isFinal();
  95. }