Doclet API

com.sun.javadoc
Interface ProgramElementDoc

All Superinterfaces:
Comparable<Object>, Doc
All Known Subinterfaces:
AnnotationTypeDoc, AnnotationTypeElementDoc, ClassDoc, ConstructorDoc, ExecutableMemberDoc, FieldDoc, MemberDoc, MethodDoc

public interface ProgramElementDoc
extends Doc

Represents a java program element: class, interface, field, constructor, or method. This is an abstract class dealing with information common to these elements.

See Also:
MemberDoc, ClassDoc

Method Summary
 AnnotationDesc[] annotations()
          Get the annotations of this program element.
 ClassDoc containingClass()
          Get the containing class or interface of this program element.
 PackageDoc containingPackage()
          Get the package that this program element is contained in.
 boolean isFinal()
          Return true if this program element is final.
 boolean isPackagePrivate()
          Return true if this program element is package private.
 boolean isPrivate()
          Return true if this program element is private.
 boolean isProtected()
          Return true if this program element is protected.
 boolean isPublic()
          Return true if this program element is public.
 boolean isStatic()
          Return true if this program element is static.
 String modifiers()
          Get modifiers string.
 int modifierSpecifier()
          Get the modifier specifier integer.
 String qualifiedName()
          Get the fully qualified name of this program element.
 
Methods inherited from interface com.sun.javadoc.Doc
commentText, compareTo, firstSentenceTags, getRawCommentText, inlineTags, isAnnotationType, isAnnotationTypeElement, isClass, isConstructor, isEnum, isEnumConstant, isError, isException, isField, isIncluded, isInterface, isMethod, isOrdinaryClass, name, position, seeTags, setRawCommentText, tags, tags
 

Method Detail

containingClass

ClassDoc containingClass()
Get the containing class or interface of this program element.

Returns:
a ClassDoc for this element's containing class or interface. If this is a top-level class or interface, return null.

containingPackage

PackageDoc containingPackage()
Get the package that this program element is contained in.

Returns:
a PackageDoc for this element containing package. If in the unnamed package, this PackageDoc will have the name "".

qualifiedName

String qualifiedName()
Get the fully qualified name of this program element. For example, for the class java.util.Hashtable, return "java.util.Hashtable".

For the method bar() in class Foo in the unnamed package, return "Foo.bar".

Returns:
the qualified name of the program element as a String.

modifierSpecifier

int modifierSpecifier()
Get the modifier specifier integer.

See Also:
Modifier

modifiers

String modifiers()
Get modifiers string. For example, for:
   public abstract int foo() { ... }
 
return "public abstract". Annotations are not included.


annotations

AnnotationDesc[] annotations()
Get the annotations of this program element. Return an empty array if there are none.

Returns:
the annotations of this program element.
Since:
1.5

isPublic

boolean isPublic()
Return true if this program element is public.


isProtected

boolean isProtected()
Return true if this program element is protected.


isPrivate

boolean isPrivate()
Return true if this program element is private.


isPackagePrivate

boolean isPackagePrivate()
Return true if this program element is package private.


isStatic

boolean isStatic()
Return true if this program element is static.


isFinal

boolean isFinal()
Return true if this program element is final.


Doclet API

Submit a bug or feature
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2010, Oracle and/or its affiliates. 500 Oracle Parkway
Redwood Shores, CA 94065 USA. All rights reserved.