mjc

org.multijava.mjdoc.mjdoc_142
Class MjProgramElementDoc

java.lang.Object
  extended byorg.multijava.mjdoc.mjdoc_142.MjDoc
      extended byorg.multijava.mjdoc.mjdoc_142.MjProgramElementDoc
All Implemented Interfaces:
Comparable, com.sun.javadoc.Doc, com.sun.javadoc.ProgramElementDoc
Direct Known Subclasses:
MjClassDoc, MjMemberDoc

public abstract class MjProgramElementDoc
extends MjDoc
implements com.sun.javadoc.ProgramElementDoc

This is an abstract class that is a super class for derived classes representing program elements such as classes, interfaces, constructors, methods, fields; it implements the javadoc ProgramElementDoc interface; derived classes wrap appropriate objects representing the program elements in the MJC class structure.

Author:
David R. Cok

Field Summary
private  MjClassDoc containingClass
          Holder for the class that contains this program element (a nested class is contained by its outer class).
private  MjPackageDoc pkg
          Holder for the package that contains this program element, as is available from the containing class.
 
Fields inherited from class org.multijava.mjdoc.mjdoc_142.MjDoc
parser
 
Constructor Summary
MjProgramElementDoc(CClass cl)
          Creates this super class object for the case that the derived class represents a class or interface; cl is the class or interface being wrapped.
MjProgramElementDoc(MjClassDoc container)
          Creates this super class object for the situation that the derived class represents some program element other than a class or interface; the argument is the class or interface that contains the program element.
 
Method Summary
 com.sun.javadoc.ClassDoc containingClass()
          Returns the class that contains this program element.
 com.sun.javadoc.PackageDoc containingPackage()
          Returns the package that contains the class that contains this program element.
 boolean isFinal()
          Returns true if this program element has the 'final' modifier in the java program.
 boolean isPackagePrivate()
          Returns true if this program element is package-private, that is it does not have the public, protected or private modifiers in the java program.
 boolean isPrivate()
          Returns true if this program element has the 'private' modifier in the java program.
 boolean isProtected()
          Returns true if this program element has the 'protected' modifier in the java program.
 boolean isPublic()
          Returns true if this program element has the 'public' modifier in the java program.
 boolean isStatic()
          Returns true if this program element has the 'static' modifier in the java program.
abstract  long longModifiers()
          Returns the long representing the java modifiers attached to this program element in the java program (cf. the constants such as ACC_PUBLIC in Constants).
 String modifiers()
          This lists the modifiers of the program element as a String, with spaces separating modifiers.
 int modifierSpecifier()
          This returns the modifiers of the program element encoded as bits of an int; the encoding is that of the javac compiler, not of the mj compiler.
abstract  String name()
          Returns the identifer of this program element, as interpreted by derived classes.
abstract  String qualifiedName()
          Returns the qualified name (package + containing classes + program element identifier) of the program element.
 
Methods inherited from class org.multijava.mjdoc.mjdoc_142.MjDoc
commentText, compareString, compareTo, firstSentenceTags, getRawCommentText, inlineTags, isClass, isConstructor, isError, isException, isField, isIncluded, isInterface, isMethod, isOrdinaryClass, notImplemented, position, seeTags, setIncluded, setRawCommentText, setRawCommentText, setRawCommentText, setRawCommentText, tags, tags, tags
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.javadoc.Doc
commentText, compareTo, firstSentenceTags, getRawCommentText, inlineTags, isClass, isConstructor, isError, isException, isField, isIncluded, isInterface, isMethod, isOrdinaryClass, position, seeTags, setRawCommentText, tags, tags
 

Field Detail

pkg

private MjPackageDoc pkg
Holder for the package that contains this program element, as is available from the containing class.


containingClass

private MjClassDoc containingClass
Holder for the class that contains this program element (a nested class is contained by its outer class).

Constructor Detail

MjProgramElementDoc

public MjProgramElementDoc(CClass cl)
Creates this super class object for the case that the derived class represents a class or interface; cl is the class or interface being wrapped.


MjProgramElementDoc

public MjProgramElementDoc(MjClassDoc container)
Creates this super class object for the situation that the derived class represents some program element other than a class or interface; the argument is the class or interface that contains the program element.

Method Detail

containingClass

public com.sun.javadoc.ClassDoc containingClass()
Returns the class that contains this program element.

Specified by:
containingClass in interface com.sun.javadoc.ProgramElementDoc

containingPackage

public com.sun.javadoc.PackageDoc containingPackage()
Returns the package that contains the class that contains this program element.

Specified by:
containingPackage in interface com.sun.javadoc.ProgramElementDoc

name

public abstract String name()
Returns the identifer of this program element, as interpreted by derived classes.

Specified by:
name in interface com.sun.javadoc.Doc

longModifiers

public abstract long longModifiers()
Returns the long representing the java modifiers attached to this program element in the java program (cf. the constants such as ACC_PUBLIC in Constants).


isFinal

public boolean isFinal()
Returns true if this program element has the 'final' modifier in the java program.

Specified by:
isFinal in interface com.sun.javadoc.ProgramElementDoc

isPackagePrivate

public boolean isPackagePrivate()
Returns true if this program element is package-private, that is it does not have the public, protected or private modifiers in the java program.

Specified by:
isPackagePrivate in interface com.sun.javadoc.ProgramElementDoc

isPrivate

public boolean isPrivate()
Returns true if this program element has the 'private' modifier in the java program.

Specified by:
isPrivate in interface com.sun.javadoc.ProgramElementDoc

isPublic

public boolean isPublic()
Returns true if this program element has the 'public' modifier in the java program.

Specified by:
isPublic in interface com.sun.javadoc.ProgramElementDoc

isProtected

public boolean isProtected()
Returns true if this program element has the 'protected' modifier in the java program.

Specified by:
isProtected in interface com.sun.javadoc.ProgramElementDoc

isStatic

public boolean isStatic()
Returns true if this program element has the 'static' modifier in the java program.

Specified by:
isStatic in interface com.sun.javadoc.ProgramElementDoc

modifiers

public String modifiers()
This lists the modifiers of the program element as a String, with spaces separating modifiers. The order of the modifiers in the output is not specified, but the following seems to match what the Standard doclet does (and is in order of increasing bit position).

Specified by:
modifiers in interface com.sun.javadoc.ProgramElementDoc

modifierSpecifier

public int modifierSpecifier()
This returns the modifiers of the program element encoded as bits of an int; the encoding is that of the javac compiler, not of the mj compiler.

Specified by:
modifierSpecifier in interface com.sun.javadoc.ProgramElementDoc

qualifiedName

public abstract String qualifiedName()
Returns the qualified name (package + containing classes + program element identifier) of the program element.

Specified by:
qualifiedName in interface com.sun.javadoc.ProgramElementDoc

mjc

mjc is Copyright (C) 2000-2004 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. mjc is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.