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