1/* 2 * Copyright (c) 1998, 2014, 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 26package com.sun.javadoc; 27 28/** 29 * Represents a java program element: class, interface, field, 30 * constructor, or method. 31 * This is an abstract class dealing with information common to 32 * these elements. 33 * 34 * @see MemberDoc 35 * @see ClassDoc 36 * 37 * @author Robert Field 38 * 39 * @deprecated 40 * The declarations in this package have been superseded by those 41 * in the package {@code jdk.javadoc.doclet}. 42 * For more information, see the <i>Migration Guide</i> in the documentation for that package. 43 */ 44@Deprecated 45public interface ProgramElementDoc extends Doc { 46 47 /** 48 * Get the containing class or interface of this program element. 49 * 50 * @return a ClassDoc for this element's containing class or interface. 51 * If this is a top-level class or interface, return null. 52 */ 53 ClassDoc containingClass(); 54 55 /** 56 * Get the package that this program element is contained in. 57 * 58 * @return a PackageDoc for this element containing package. 59 * If in the unnamed package, this PackageDoc will have the 60 * name "". 61 */ 62 PackageDoc containingPackage(); 63 64 /** 65 * Get the fully qualified name of this program element. 66 * For example, for the class {@code java.util.Hashtable}, 67 * return "java.util.Hashtable". 68 * <p> 69 * For the method {@code bar()} in class {@code Foo} 70 * in the unnamed package, return "Foo.bar". 71 * 72 * @return the qualified name of the program element as a String. 73 */ 74 String qualifiedName(); 75 76 /** 77 * Get the modifier specifier integer. 78 * 79 * @see java.lang.reflect.Modifier 80 * 81 * @return Get the modifier specifier integer. 82 */ 83 int modifierSpecifier(); 84 85 /** 86 * Get modifiers string. 87 * For example, for: 88 * <pre> 89 * public abstract int foo() { ... } 90 * </pre> 91 * return "public abstract". 92 * Annotations are not included. 93 * 94 * @return "public abstract". 95 */ 96 String modifiers(); 97 98 /** 99 * Get the annotations of this program element. 100 * Return an empty array if there are none. 101 * 102 * @return the annotations of this program element. 103 * @since 1.5 104 */ 105 AnnotationDesc[] annotations(); 106 107 /** 108 * Return true if this program element is public. 109 * 110 * @return true if this program element is public. 111 */ 112 boolean isPublic(); 113 114 /** 115 * Return true if this program element is protected. 116 * 117 * @return true if this program element is protected. 118 */ 119 boolean isProtected(); 120 121 /** 122 * Return true if this program element is private. 123 * 124 * @return true if this program element is private. 125 */ 126 boolean isPrivate(); 127 128 /** 129 * Return true if this program element is package private. 130 * 131 * @return true if this program element is package private. 132 */ 133 boolean isPackagePrivate(); 134 /** 135 * Return true if this program element is static. 136 * 137 * @return true if this program element is static. 138 */ 139 boolean isStatic(); 140 141 /** 142 * Return true if this program element is final. 143 * 144 * @return true if this program element is final. 145 */ 146 boolean isFinal(); 147} 148