ProgramElementDoc.java revision 2571:10fc81ac75b4
11573Srgrimes/*
23070Spst * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
31573Srgrimes * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
41573Srgrimes *
51573Srgrimes * This code is free software; you can redistribute it and/or modify it
61573Srgrimes * under the terms of the GNU General Public License version 2 only, as
71573Srgrimes * published by the Free Software Foundation.  Oracle designates this
81573Srgrimes * particular file as subject to the "Classpath" exception as provided
91573Srgrimes * by Oracle in the LICENSE file that accompanied this code.
101573Srgrimes *
111573Srgrimes * This code is distributed in the hope that it will be useful, but WITHOUT
121573Srgrimes * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
133070Spst * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
141573Srgrimes * version 2 for more details (a copy is included in the LICENSE file that
151573Srgrimes * accompanied this code).
161573Srgrimes *
171573Srgrimes * You should have received a copy of the GNU General Public License version
181573Srgrimes * 2 along with this work; if not, write to the Free Software Foundation,
191573Srgrimes * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
201573Srgrimes *
211573Srgrimes * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
221573Srgrimes * or visit www.oracle.com if you need additional information or have any
231573Srgrimes * questions.
241573Srgrimes */
251573Srgrimes
2692986Sobrienpackage com.sun.javadoc;
2792986Sobrien
281573Srgrimes/**
291573Srgrimes * Represents a java program element: class, interface, field,
301573Srgrimes * constructor, or method.
311573Srgrimes * This is an abstract class dealing with information common to
321573Srgrimes * these elements.
331573Srgrimes *
341573Srgrimes * @see MemberDoc
351573Srgrimes * @see ClassDoc
361573Srgrimes *
3765532Snectar * @author Robert Field
3865532Snectar */
3917903Speterpublic interface ProgramElementDoc extends Doc {
4017903Speter
411573Srgrimes    /**
4265532Snectar     * Get the containing class or interface of this program element.
4365532Snectar     *
4465532Snectar     * @return a ClassDoc for this element's containing class or interface.
4565532Snectar     * If this is a top-level class or interface, return null.
4665532Snectar     */
4765532Snectar    ClassDoc containingClass();
481991Swollman
4965532Snectar    /**
5065532Snectar     * Get the package that this program element is contained in.
5165532Snectar     *
5265532Snectar     * @return a PackageDoc for this element containing package.
5365532Snectar     * If in the unnamed package, this PackageDoc will have the
541991Swollman     * name "".
551991Swollman     */
561573Srgrimes    PackageDoc containingPackage();
571991Swollman
581991Swollman    /**
5917903Speter     * Get the fully qualified name of this program element.
6017903Speter     * For example, for the class {@code java.util.Hashtable},
6167709Sume     * return "java.util.Hashtable".
6267709Sume     * <p>
6367709Sume     * For the method {@code bar()} in class {@code Foo}
6467709Sume     * in the unnamed package, return "Foo.bar".
6517903Speter     *
6617903Speter     * @return the qualified name of the program element as a String.
6717903Speter     */
6817903Speter    String qualifiedName();
6917903Speter
7017903Speter    /**
7117903Speter     * Get the modifier specifier integer.
7217903Speter     *
7317903Speter     * @see java.lang.reflect.Modifier
7417903Speter     *
7517903Speter     * @return Get the modifier specifier integer.
761991Swollman     */
7765532Snectar    int modifierSpecifier();
781991Swollman
7965532Snectar    /**
8065532Snectar     * Get modifiers string.
8165532Snectar     * For example, for:
8265532Snectar     * <pre>
8365532Snectar     *   public abstract int foo() { ... }
8465532Snectar     * </pre>
8565532Snectar     * return "public abstract".
8665532Snectar     * Annotations are not included.
8765532Snectar     *
881991Swollman     * @return "public abstract".
8965532Snectar     */
9065532Snectar    String modifiers();
9165532Snectar
9265532Snectar    /**
931991Swollman     * Get the annotations of this program element.
941991Swollman     * Return an empty array if there are none.
951991Swollman     *
961991Swollman     * @return the annotations of this program element.
971991Swollman     * @since 1.5
981991Swollman     */
9965532Snectar    AnnotationDesc[] annotations();
1001991Swollman
10165532Snectar    /**
10265532Snectar     * Return true if this program element is public.
10365532Snectar     *
10465532Snectar     * @return true if this program element is public.
10565532Snectar     */
10665532Snectar    boolean isPublic();
1071991Swollman
10865532Snectar    /**
10965532Snectar     * Return true if this program element is protected.
11065532Snectar     *
11165532Snectar     * @return true if this program element is protected.
11265532Snectar     */
11365532Snectar    boolean isProtected();
11465532Snectar
1151991Swollman    /**
1161991Swollman     * Return true if this program element is private.
11717706Sjulian     *
11817706Sjulian     * @return true if this program element is private.
11917706Sjulian     */
12017706Sjulian    boolean isPrivate();
12117706Sjulian
12217706Sjulian    /**
12317706Sjulian     * Return true if this program element is package private.
12417706Sjulian     *
12531984Salex     * @return true if this program element is package private.
12617706Sjulian     */
12717706Sjulian    boolean isPackagePrivate();
12817706Sjulian    /**
12917706Sjulian     * Return true if this program element is static.
13017706Sjulian     *
13117706Sjulian     * @return true if this program element is static.
13217706Sjulian     */
13317706Sjulian    boolean isStatic();
13417706Sjulian
13517706Sjulian    /**
1363070Spst     * Return true if this program element is final.
1373070Spst     *
1383070Spst     * @return true if this program element is final.
1393070Spst     */
1403070Spst    boolean isFinal();
1413070Spst}
1423070Spst