1 /* 2 * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package com.sun.mirror.declaration; 27 28 29 import java.util.Collection; 30 31 import com.sun.mirror.type.ClassType; 32 33 34 /** 35 * Represents the declaration of a class. 36 * For the declaration of an interface, see {@link InterfaceDeclaration}. 37 * Provides access to information about the class, its members, and 38 * its constructors. 39 * Note that an {@linkplain EnumDeclaration enum} is a kind of class. 40 * 41 * <p> While a <tt>ClassDeclaration</tt> represents the <i>declaration</i> 42 * of a class, a {@link ClassType} represents a class <i>type</i>. 43 * See {@link TypeDeclaration} for more on this distinction. 44 * 45 * <p> {@link com.sun.mirror.util.DeclarationFilter} 46 * provides a simple way to select just the items of interest 47 * when a method returns a collection of declarations. 48 * 49 * @deprecated All components of this API have been superseded by the 50 * standardized annotation processing API. The replacement for the 51 * functionality of this interface is included in {@link 52 * javax.lang.model.element.TypeElement}. 53 * 54 * @author Joseph D. Darcy 55 * @author Scott Seligman 56 * 57 * @see ClassType 58 * @since 1.5 59 */ 60 @Deprecated 61 @SuppressWarnings("deprecation") 62 public interface ClassDeclaration extends TypeDeclaration { 63 64 /** 65 * Returns the class type directly extended by this class. 66 * The only class with no superclass is <tt>java.lang.Object</tt>, 67 * for which this method returns null. 68 * 69 * @return the class type directly extended by this class, or null 70 * if there is none 71 */ 72 ClassType getSuperclass(); 73 74 /** 75 * Returns the constructors of this class. 76 * This includes the default constructor if this class has 77 * no constructors explicitly declared. 78 * 79 * @return the constructors of this class 80 * 81 * @see com.sun.mirror.util.DeclarationFilter 82 */ 83 Collection<ConstructorDeclaration> getConstructors(); 84 85 /** 86 * {@inheritDoc} 87 */ 88 Collection<MethodDeclaration> getMethods(); 89 }