01: /*
02: * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
03: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
04: *
05: * This code is free software; you can redistribute it and/or modify it
06: * under the terms of the GNU General Public License version 2 only, as
07: * published by the Free Software Foundation. Sun designates this
08: * particular file as subject to the "Classpath" exception as provided
09: * by Sun in the LICENSE file that accompanied this code.
10: *
11: * This code is distributed in the hope that it will be useful, but WITHOUT
12: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14: * version 2 for more details (a copy is included in the LICENSE file that
15: * accompanied this code).
16: *
17: * You should have received a copy of the GNU General Public License version
18: * 2 along with this work; if not, write to the Free Software Foundation,
19: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20: *
21: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22: * CA 95054 USA or visit www.sun.com if you need additional information or
23: * have any questions.
24: */
25:
26: package com.sun.mirror.declaration;
27:
28: import java.util.Collection;
29:
30: import com.sun.mirror.type.ClassType;
31:
32: /**
33: * Represents the declaration of a class.
34: * For the declaration of an interface, see {@link InterfaceDeclaration}.
35: * Provides access to information about the class, its members, and
36: * its constructors.
37: * Note that an {@linkplain EnumDeclaration enum} is a kind of class.
38: *
39: * <p> While a <tt>ClassDeclaration</tt> represents the <i>declaration</i>
40: * of a class, a {@link ClassType} represents a class <i>type</i>.
41: * See {@link TypeDeclaration} for more on this distinction.
42: *
43: * <p> {@link com.sun.mirror.util.DeclarationFilter}
44: * provides a simple way to select just the items of interest
45: * when a method returns a collection of declarations.
46: *
47: * @author Joseph D. Darcy
48: * @author Scott Seligman
49: * @version 1.10 07/05/05
50: *
51: * @see ClassType
52: * @since 1.5
53: */
54:
55: public interface ClassDeclaration extends TypeDeclaration {
56:
57: /**
58: * Returns the class type directly extended by this class.
59: * The only class with no superclass is <tt>java.lang.Object</tt>,
60: * for which this method returns null.
61: *
62: * @return the class type directly extended by this class, or null
63: * if there is none
64: */
65: ClassType getSuperclass();
66:
67: /**
68: * Returns the constructors of this class.
69: * This includes the default constructor if this class has
70: * no constructors explicitly declared.
71: *
72: * @return the constructors of this class
73: *
74: * @see com.sun.mirror.util.DeclarationFilter
75: */
76: Collection<ConstructorDeclaration> getConstructors();
77:
78: /**
79: * {@inheritDoc}
80: */
81: Collection<MethodDeclaration> getMethods();
82: }
|