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