mjc

org.multijava.mjdoc.mjdoc_142
Class MjMethodDoc

java.lang.Object
  extended byorg.multijava.mjdoc.mjdoc_142.MjDoc
      extended byorg.multijava.mjdoc.mjdoc_142.MjProgramElementDoc
          extended byorg.multijava.mjdoc.mjdoc_142.MjMemberDoc
              extended byorg.multijava.mjdoc.mjdoc_142.MjExecutableMemberDoc
                  extended byorg.multijava.mjdoc.mjdoc_142.MjMethodDoc
All Implemented Interfaces:
Comparable, com.sun.javadoc.Doc, com.sun.javadoc.ExecutableMemberDoc, com.sun.javadoc.MemberDoc, com.sun.javadoc.MethodDoc, com.sun.javadoc.ProgramElementDoc

public class MjMethodDoc
extends MjExecutableMemberDoc
implements com.sun.javadoc.MethodDoc

This class represents a method (but not constructor) of a class; it is the bridge between the MJC syntax tree object and the MethodDoc interface of javadoc doclets. It wraps a JMethodDeclarationType object, or simply CMethod object if only a binary representation is available.

Author:
David R. Cok

Nested Class Summary
 
Nested classes inherited from class org.multijava.mjdoc.mjdoc_142.MjExecutableMemberDoc
MjExecutableMemberDoc.Comp
 
Field Summary
private  boolean isExternal
          Records if this method is an external method or not (only valid if the object is constructed using source code.
private  MjMethodDoc topConcreteMethod
          Cached value of the top method that this method overrides.
private  MjExtMethodsDoc unit
          The associated MjExtMethodsDoc object if this is external.
 
Fields inherited from class org.multijava.mjdoc.mjdoc_142.MjExecutableMemberDoc
 
Fields inherited from class org.multijava.mjdoc.mjdoc_142.MjProgramElementDoc
 
Fields inherited from class org.multijava.mjdoc.mjdoc_142.MjDoc
parser
 
Constructor Summary
MjMethodDoc(CMethod cm, MjClassDoc container)
          This constructs an object in cases where only binary code is available.
MjMethodDoc(JMethodDeclarationType jm, MjClassDoc container)
          This constructs an object in cases where source code is available and hence a JMethodDeclarationType object is available.
 
Method Summary
protected  String compareString()
          Returns a String representation, used for ordering.
 com.sun.javadoc.PackageDoc cuPackage()
          Returns the package containing the compilation unit that declares this method.
 MjExtMethodsDoc externalUnit()
          Returns the compilation unit the method is declared in; applicable only to external methods.
 String gfFileName()
          Cached value of the local top method that this method overrides.
 boolean isAbstract()
          Returns true if the method is abstract.
 boolean isExternal()
          Returns true if this method is declared outside its host class.
 boolean isMethod()
          Returns true since this object represents a method.
 String location()
           
 String name()
          Returns the identifier of the method, without package or enclosing classes.
 com.sun.javadoc.ClassDoc overriddenClass()
          Returns the super class that contains the method that this method overrides, or null if there is no such class.
 com.sun.javadoc.MethodDoc overriddenMethod()
          Return the method that this method overrides.
 String qualifiedName()
          Returns the fully-qualified identifier of the method.
 com.sun.javadoc.Type returnType()
           
 boolean sameMethod(MjMethodDoc m)
          A modified parser class used by #setRawCommentText to add additional information about multijava external methods.
 void setExternalUnit(MjExtMethodsDoc m)
          Records the compilation unit the method is declared in; applicable only to external methods.
 MjMethodDoc topConcreteMethod()
          Returns the top concrete method of this method.
 
Methods inherited from class org.multijava.mjdoc.mjdoc_142.MjExecutableMemberDoc
cmethod, flatSignature, isNative, isSynchronized, jmethod, longModifiers, parameters, parameterSignature, paramTags, signature, thrownExceptions, throwsTags, toString
 
Methods inherited from class org.multijava.mjdoc.mjdoc_142.MjMemberDoc
isSynthetic
 
Methods inherited from class org.multijava.mjdoc.mjdoc_142.MjProgramElementDoc
containingClass, containingPackage, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, modifiers, modifierSpecifier
 
Methods inherited from class org.multijava.mjdoc.mjdoc_142.MjDoc
commentText, compareTo, firstSentenceTags, getRawCommentText, inlineTags, isClass, isConstructor, isError, isException, isField, isIncluded, isInterface, 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, wait, wait, wait
 
Methods inherited from interface com.sun.javadoc.ExecutableMemberDoc
flatSignature, isNative, isSynchronized, parameters, paramTags, signature, thrownExceptions, throwsTags
 
Methods inherited from interface com.sun.javadoc.MemberDoc
isSynthetic
 
Methods inherited from interface com.sun.javadoc.ProgramElementDoc
containingClass, containingPackage, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, modifiers, modifierSpecifier
 
Methods inherited from interface com.sun.javadoc.Doc
commentText, compareTo, firstSentenceTags, getRawCommentText, inlineTags, isClass, isConstructor, isError, isException, isField, isIncluded, isInterface, isOrdinaryClass, position, seeTags, setRawCommentText, tags, tags
 

Field Detail

isExternal

private boolean isExternal
Records if this method is an external method or not (only valid if the object is constructed using source code.


unit

private MjExtMethodsDoc unit
The associated MjExtMethodsDoc object if this is external.


topConcreteMethod

private MjMethodDoc topConcreteMethod
Cached value of the top method that this method overrides.

Constructor Detail

MjMethodDoc

public MjMethodDoc(CMethod cm,
                   MjClassDoc container)
This constructs an object in cases where only binary code is available.

Parameters:
cm - the object wrapped by this class, representing a method in the java program
container - the class of which cm is a member

MjMethodDoc

public MjMethodDoc(JMethodDeclarationType jm,
                   MjClassDoc container)
This constructs an object in cases where source code is available and hence a JMethodDeclarationType object is available.

Parameters:
jm - the object wrapped by this class, representing a method in the java program
container - the class of which jm is a member
Method Detail

name

public String name()
Returns the identifier of the method, without package or enclosing classes.

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

qualifiedName

public String qualifiedName()
Returns the fully-qualified identifier of the method.

Specified by:
qualifiedName in interface com.sun.javadoc.ProgramElementDoc
Overrides:
qualifiedName in class MjExecutableMemberDoc

compareString

protected String compareString()
Returns a String representation, used for ordering.

Overrides:
compareString in class MjExecutableMemberDoc

isAbstract

public boolean isAbstract()
Returns true if the method is abstract.

Specified by:
isAbstract in interface com.sun.javadoc.MethodDoc

isMethod

public boolean isMethod()
Returns true since this object represents a method.

Specified by:
isMethod in interface com.sun.javadoc.Doc
Overrides:
isMethod in class MjDoc

isExternal

public boolean isExternal()
Returns true if this method is declared outside its host class.


overriddenClass

public com.sun.javadoc.ClassDoc overriddenClass()
Returns the super class that contains the method that this method overrides, or null if there is no such class.

Specified by:
overriddenClass in interface com.sun.javadoc.MethodDoc

overriddenMethod

public com.sun.javadoc.MethodDoc overriddenMethod()
Return the method that this method overrides. Added for JDK 1.4 compatability.

Specified by:
overriddenMethod in interface com.sun.javadoc.MethodDoc
Returns:
a MethodDoc representing a method definition in a superclass this method overrides, null if this method does not override.

externalUnit

public MjExtMethodsDoc externalUnit()
Returns the compilation unit the method is declared in; applicable only to external methods.


setExternalUnit

public void setExternalUnit(MjExtMethodsDoc m)
Records the compilation unit the method is declared in; applicable only to external methods.


cuPackage

public com.sun.javadoc.PackageDoc cuPackage()
Returns the package containing the compilation unit that declares this method.


returnType

public com.sun.javadoc.Type returnType()
Specified by:
returnType in interface com.sun.javadoc.MethodDoc

location

public String location()

sameMethod

public boolean sameMethod(MjMethodDoc m)
A modified parser class used by #setRawCommentText to add additional information about multijava external methods. Returns true if the receiver and argument have the same identifier and static parameter types (but may have different receiver types).


topConcreteMethod

public MjMethodDoc topConcreteMethod()
Returns the top concrete method of this method.


gfFileName

public String gfFileName()
Cached value of the local top method that this method overrides. Finds the topmost method that is still in this package. Returns the name of the html file (without directory path) for the generic function that this method should be documented in.


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.