KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > javadoc > ProgramElementDoc


1 /*
2  * @(#)ProgramElementDoc.java 1.8 02/10/04
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.javadoc;
9
10 /**
11  * Represents a java program element: class, interface, field,
12  * constructor, or method.
13  * This is an abstract class dealing with information common to
14  * these elements.
15  *
16  * @see MemberDoc
17  * @see ClassDoc
18  *
19  * @author Robert Field
20  */

21 public interface ProgramElementDoc extends Doc {
22
23     /**
24      * Get the containing class or interface of this program element.
25      *
26      * @return a ClassDoc for this element's containing class or interface.
27      * If this is a top-level class or interface, return null.
28      */

29     ClassDoc containingClass();
30
31     /**
32      * Get the package that this program element is contained in.
33      *
34      * @return a PackageDoc for this element containing package.
35      * If in the unnamed package, this PackageDoc will have the
36      * name "".
37      */

38     PackageDoc containingPackage();
39
40     /**
41      * Get the fully qualified name of this program element.
42      * For example, for the class <code>java.util.Hashtable</code>,
43      * return "java.util.Hashtable".
44      * <p>
45      * For the method <code>bar()</code> in class <code>Foo</code>
46      * in the unnamed package, return "Foo.bar".
47      * </pre>
48      *
49      * @return the qualified name of the program element as a String.
50      */

51     String JavaDoc qualifiedName();
52
53     /**
54      * Get the modifier specifier integer.
55      *
56      * @see java.lang.reflect.Modifier
57      */

58     int modifierSpecifier();
59
60     /**
61      * Get modifiers string.
62      * For example, for:
63      * <pre>
64      * public abstract int foo() { ... }
65      * </pre>
66      * return "public abstract".
67      * Annotations are not included.
68      */

69     String JavaDoc modifiers();
70
71     /**
72      * Get the annotations of this program element.
73      * Return an empty array if there are none.
74      *
75      * @return the annotations of this program element.
76      * @since 1.5
77      */

78     AnnotationDesc[] annotations();
79
80     /**
81      * Return true if this program element is public.
82      */

83     boolean isPublic();
84
85     /**
86      * Return true if this program element is protected.
87      */

88     boolean isProtected();
89
90     /**
91      * Return true if this program element is private.
92      */

93     boolean isPrivate();
94
95     /**
96      * Return true if this program element is package private.
97      */

98     boolean isPackagePrivate();
99     /**
100      * Return true if this program element is static.
101      */

102     boolean isStatic();
103
104     /**
105      * Return true if this program element is final.
106      */

107     boolean isFinal();
108 }
109
Popular Tags