1. /*
  2. * @(#)ClassDeclaration.java 1.3 04/02/20
  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.mirror.declaration;
  8. import java.util.Collection;
  9. import com.sun.mirror.type.ClassType;
  10. /**
  11. * Represents the declaration of a class.
  12. * For the declaration of an interface, see {@link InterfaceDeclaration}.
  13. * Provides access to information about the class, its members, and
  14. * its constructors.
  15. * Note that an {@linkplain EnumDeclaration enum} is a kind of class.
  16. *
  17. * <p> While a <tt>ClassDeclaration</tt> represents the <i>declaration</i>
  18. * of a class, a {@link ClassType} represents a class <i>type</i>.
  19. * See {@link TypeDeclaration} for more on this distinction.
  20. *
  21. * <p> {@link com.sun.mirror.util.DeclarationFilter}
  22. * provides a simple way to select just the items of interest
  23. * when a method returns a collection of declarations.
  24. *
  25. * @author Joseph D. Darcy
  26. * @author Scott Seligman
  27. * @version 1.3 04/02/20
  28. *
  29. * @see ClassType
  30. * @since 1.5
  31. */
  32. public interface ClassDeclaration extends TypeDeclaration {
  33. /**
  34. * Returns the class type directly extended by this class.
  35. * The only class with no superclass is <tt>java.lang.Object</tt>,
  36. * for which this method returns null.
  37. *
  38. * @return the class type directly extended by this class, or null
  39. * if there is none
  40. */
  41. ClassType getSuperclass();
  42. /**
  43. * Returns the constructors of this class.
  44. * This includes the default constructor if this class has
  45. * no constructors explicitly declared.
  46. *
  47. * @return the constructors of this class
  48. *
  49. * @see com.sun.mirror.util.DeclarationFilter
  50. */
  51. Collection<ConstructorDeclaration> getConstructors();
  52. /**
  53. * {@inheritDoc}
  54. */
  55. Collection<MethodDeclaration> getMethods();
  56. }