1 /* |
|
2 * Copyright (c) 1998, 2018, 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.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(since="9", forRemoval=true) |
|
45 @SuppressWarnings("removal") |
|
46 public interface ProgramElementDoc extends Doc { |
|
47 |
|
48 /** |
|
49 * Get the containing class or interface of this program element. |
|
50 * |
|
51 * @return a ClassDoc for this element's containing class or interface. |
|
52 * If this is a top-level class or interface, return null. |
|
53 */ |
|
54 ClassDoc containingClass(); |
|
55 |
|
56 /** |
|
57 * Get the package that this program element is contained in. |
|
58 * |
|
59 * @return a PackageDoc for this element containing package. |
|
60 * If in the unnamed package, this PackageDoc will have the |
|
61 * name "". |
|
62 */ |
|
63 PackageDoc containingPackage(); |
|
64 |
|
65 /** |
|
66 * Get the fully qualified name of this program element. |
|
67 * For example, for the class {@code java.util.Hashtable}, |
|
68 * return "java.util.Hashtable". |
|
69 * <p> |
|
70 * For the method {@code bar()} in class {@code Foo} |
|
71 * in the unnamed package, return "Foo.bar". |
|
72 * |
|
73 * @return the qualified name of the program element as a String. |
|
74 */ |
|
75 String qualifiedName(); |
|
76 |
|
77 /** |
|
78 * Get the modifier specifier integer. |
|
79 * |
|
80 * @see java.lang.reflect.Modifier |
|
81 * |
|
82 * @return Get the modifier specifier integer. |
|
83 */ |
|
84 int modifierSpecifier(); |
|
85 |
|
86 /** |
|
87 * Get modifiers string. |
|
88 * For example, for: |
|
89 * <pre> |
|
90 * public abstract int foo() { ... } |
|
91 * </pre> |
|
92 * return "public abstract". |
|
93 * Annotations are not included. |
|
94 * |
|
95 * @return "public abstract". |
|
96 */ |
|
97 String modifiers(); |
|
98 |
|
99 /** |
|
100 * Get the annotations of this program element. |
|
101 * Return an empty array if there are none. |
|
102 * |
|
103 * @return the annotations of this program element. |
|
104 * @since 1.5 |
|
105 */ |
|
106 AnnotationDesc[] annotations(); |
|
107 |
|
108 /** |
|
109 * Return true if this program element is public. |
|
110 * |
|
111 * @return true if this program element is public. |
|
112 */ |
|
113 boolean isPublic(); |
|
114 |
|
115 /** |
|
116 * Return true if this program element is protected. |
|
117 * |
|
118 * @return true if this program element is protected. |
|
119 */ |
|
120 boolean isProtected(); |
|
121 |
|
122 /** |
|
123 * Return true if this program element is private. |
|
124 * |
|
125 * @return true if this program element is private. |
|
126 */ |
|
127 boolean isPrivate(); |
|
128 |
|
129 /** |
|
130 * Return true if this program element is package private. |
|
131 * |
|
132 * @return true if this program element is package private. |
|
133 */ |
|
134 boolean isPackagePrivate(); |
|
135 /** |
|
136 * Return true if this program element is static. |
|
137 * |
|
138 * @return true if this program element is static. |
|
139 */ |
|
140 boolean isStatic(); |
|
141 |
|
142 /** |
|
143 * Return true if this program element is final. |
|
144 * |
|
145 * @return true if this program element is final. |
|
146 */ |
|
147 boolean isFinal(); |
|
148 } |
|