duke@1: /* ohair@554: * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. duke@1: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. duke@1: * duke@1: * This code is free software; you can redistribute it and/or modify it duke@1: * under the terms of the GNU General Public License version 2 only, as ohair@554: * published by the Free Software Foundation. Oracle designates this duke@1: * particular file as subject to the "Classpath" exception as provided ohair@554: * by Oracle in the LICENSE file that accompanied this code. duke@1: * duke@1: * This code is distributed in the hope that it will be useful, but WITHOUT duke@1: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or duke@1: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License duke@1: * version 2 for more details (a copy is included in the LICENSE file that duke@1: * accompanied this code). duke@1: * duke@1: * You should have received a copy of the GNU General Public License version duke@1: * 2 along with this work; if not, write to the Free Software Foundation, duke@1: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. duke@1: * ohair@554: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ohair@554: * or visit www.oracle.com if you need additional information or have any ohair@554: * questions. duke@1: */ duke@1: duke@1: package com.sun.javadoc; duke@1: duke@1: /** duke@1: * Represents a java program element: class, interface, field, duke@1: * constructor, or method. duke@1: * This is an abstract class dealing with information common to duke@1: * these elements. duke@1: * duke@1: * @see MemberDoc duke@1: * @see ClassDoc duke@1: * duke@1: * @author Robert Field duke@1: */ duke@1: public interface ProgramElementDoc extends Doc { duke@1: duke@1: /** duke@1: * Get the containing class or interface of this program element. duke@1: * duke@1: * @return a ClassDoc for this element's containing class or interface. duke@1: * If this is a top-level class or interface, return null. duke@1: */ duke@1: ClassDoc containingClass(); duke@1: duke@1: /** duke@1: * Get the package that this program element is contained in. duke@1: * duke@1: * @return a PackageDoc for this element containing package. duke@1: * If in the unnamed package, this PackageDoc will have the duke@1: * name "". duke@1: */ duke@1: PackageDoc containingPackage(); duke@1: duke@1: /** duke@1: * Get the fully qualified name of this program element. duke@1: * For example, for the class java.util.Hashtable, duke@1: * return "java.util.Hashtable". duke@1: *

duke@1: * For the method bar() in class Foo duke@1: * in the unnamed package, return "Foo.bar". duke@1: * duke@1: * @return the qualified name of the program element as a String. duke@1: */ duke@1: String qualifiedName(); duke@1: duke@1: /** duke@1: * Get the modifier specifier integer. duke@1: * duke@1: * @see java.lang.reflect.Modifier duke@1: */ duke@1: int modifierSpecifier(); duke@1: duke@1: /** duke@1: * Get modifiers string. duke@1: * For example, for: duke@1: *

duke@1:      *   public abstract int foo() { ... }
duke@1:      * 
duke@1: * return "public abstract". duke@1: * Annotations are not included. duke@1: */ duke@1: String modifiers(); duke@1: duke@1: /** duke@1: * Get the annotations of this program element. duke@1: * Return an empty array if there are none. duke@1: * duke@1: * @return the annotations of this program element. duke@1: * @since 1.5 duke@1: */ duke@1: AnnotationDesc[] annotations(); duke@1: duke@1: /** duke@1: * Return true if this program element is public. duke@1: */ duke@1: boolean isPublic(); duke@1: duke@1: /** duke@1: * Return true if this program element is protected. duke@1: */ duke@1: boolean isProtected(); duke@1: duke@1: /** duke@1: * Return true if this program element is private. duke@1: */ duke@1: boolean isPrivate(); duke@1: duke@1: /** duke@1: * Return true if this program element is package private. duke@1: */ duke@1: boolean isPackagePrivate(); duke@1: /** duke@1: * Return true if this program element is static. duke@1: */ duke@1: boolean isStatic(); duke@1: duke@1: /** duke@1: * Return true if this program element is final. duke@1: */ duke@1: boolean isFinal(); duke@1: }