mjc

org.multijava.mjdoc.mjdoc_142
Class MjDoc

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

public abstract class MjDoc
extends Object
implements com.sun.javadoc.Doc

This abstract class provides an implementation of the Doclet Doc class. Each Doc object represents a syntatical item, such as a field, method, or class and may have a javadoc comment associated with it.

Author:
David R. Cok

Field Summary
private  boolean included
          Holds the value indicating whether this file is included in the documentation being generated.
protected  MjTagParser parser
          Holds an object that contains a representation of the javadoc comment associated with this Doc item (once initialized with the javadoc comment text).
 
Constructor Summary
MjDoc()
           
 
Method Summary
 String commentText()
          Returns the descriptive section of the javadoc comment as unparsed text.
protected  String compareString()
          This generates the String representation used by compareTo.
 int compareTo(Object o)
          This compares two Doc objects.
abstract  com.sun.javadoc.PackageDoc containingPackage()
          Returns the package this Doc is in.
 com.sun.javadoc.Tag[] firstSentenceTags()
          Returns the summary of the description of the javadoc comment (as set by setRawCommentText) as a sequence of tags.
 String getRawCommentText()
          Returns the full unparsed javadoc comment (as set by setRawCommentText).
 com.sun.javadoc.Tag[] inlineTags()
          Returns the descriptive section of the javadoc comment (as set by setRawCommentText) as parsed into a sequence of Text and inline tags.
 boolean isClass()
          Returns true if this Doc element represents a class (not an interface, field, method, constructor).
 boolean isConstructor()
          Returns true if this Doc element represents a constructor.
 boolean isError()
          Returns true if this Doc element represents a class derived from java.lang.Error.
 boolean isException()
          Returns true if this Doc element represents a class derived from java.lang.Exception.
 boolean isField()
          Returns true if this Doc element represents a field.
 boolean isIncluded()
          Returns true if this Doc is in the active set.
 boolean isInterface()
          Returns true if this Doc element represents an interface (as opposed to a class, method or field).
 boolean isMethod()
          Returns true if this Doc element represents a method (but not a constructor).
 boolean isOrdinaryClass()
          Returns true if this Doc element represents a class that is not an interface, error or exception class.
abstract  String name()
          Returns the name of the item, as interpreted by derived classes.
protected  void notImplemented(String s)
          This is called by derived classes in methods that are not implemented or are not expected to be called.
 com.sun.javadoc.SourcePosition position()
           
 com.sun.javadoc.SeeTag[] seeTags()
          Returns the sequence of tags representing all the '@see' tags in the tag section of the javadoc comment as set in setRawCommentText.
 void setIncluded(boolean b)
          Sets the included field.
 void setRawCommentText()
           
 void setRawCommentText(String rawDocumentation)
          Deprecated.  
 void setRawCommentText(String rawDocumentation, com.sun.javadoc.SourcePosition sp)
           
 void setRawCommentText(String rawDocumentation, TokenReference tok)
           
 com.sun.javadoc.Tag[] tags()
          Returns the sequence of tags representing the tag section of the javadoc comment as set in setRawCommentText.
 com.sun.javadoc.Tag[] tags(String tagkind)
          Returns the sequence of tags representing all the tags with the given 'kind' in the tag section of the javadoc comment as set in setRawCommentText.
 com.sun.javadoc.Tag[] tags(String tagkind, com.sun.javadoc.Tag[] type)
          Returns the sequence of tags representing all the tags with the given 'kind' in the tag section of the javadoc comment as set in setRawCommentText.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parser

protected MjTagParser parser
Holds an object that contains a representation of the javadoc comment associated with this Doc item (once initialized with the javadoc comment text).


included

private boolean included
Holds the value indicating whether this file is included in the documentation being generated.

Constructor Detail

MjDoc

public MjDoc()
Method Detail

commentText

public String commentText()
Returns the descriptive section of the javadoc comment as unparsed text.

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

compareTo

public int compareTo(Object o)
This compares two Doc objects. There is no specification of this comparison for javadoc, so this is not guaranteed to be a good comparator or the same comparator as javadoc's. This implementation compares String representations of the two objects. It is used to provide ordered lists of members and classes in various places in the javadoc documentation.

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

compareString

protected String compareString()
This generates the String representation used by compareTo. We use a different method than toString, because toString is not unique in all cases (e.g. methods with the same identifier but different arguments).


firstSentenceTags

public com.sun.javadoc.Tag[] firstSentenceTags()
Returns the summary of the description of the javadoc comment (as set by setRawCommentText) as a sequence of tags.

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

getRawCommentText

public String getRawCommentText()
Returns the full unparsed javadoc comment (as set by setRawCommentText).

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

inlineTags

public com.sun.javadoc.Tag[] inlineTags()
Returns the descriptive section of the javadoc comment (as set by setRawCommentText) as parsed into a sequence of Text and inline tags.

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

isClass

public boolean isClass()
Returns true if this Doc element represents a class (not an interface, field, method, constructor).

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

isConstructor

public boolean isConstructor()
Returns true if this Doc element represents a constructor.

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

isError

public boolean isError()
Returns true if this Doc element represents a class derived from java.lang.Error.

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

isException

public boolean isException()
Returns true if this Doc element represents a class derived from java.lang.Exception.

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

isField

public boolean isField()
Returns true if this Doc element represents a field.

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

isIncluded

public boolean isIncluded()
Returns true if this Doc is in the active set.

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

setIncluded

public void setIncluded(boolean b)
Sets the included field.


isInterface

public boolean isInterface()
Returns true if this Doc element represents an interface (as opposed to a class, method or field).

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

isMethod

public boolean isMethod()
Returns true if this Doc element represents a method (but not a constructor).

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

isOrdinaryClass

public boolean isOrdinaryClass()
Returns true if this Doc element represents a class that is not an interface, error or exception class.

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

name

public abstract String name()
Returns the name of the item, as interpreted by derived classes.

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

containingPackage

public abstract com.sun.javadoc.PackageDoc containingPackage()
Returns the package this Doc is in.


seeTags

public com.sun.javadoc.SeeTag[] seeTags()
Returns the sequence of tags representing all the '@see' tags in the tag section of the javadoc comment as set in setRawCommentText.

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

setRawCommentText

public void setRawCommentText(String rawDocumentation)
Deprecated.  

Sets the javadoc comment text.

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

setRawCommentText

public void setRawCommentText()

setRawCommentText

public void setRawCommentText(String rawDocumentation,
                              TokenReference tok)

setRawCommentText

public void setRawCommentText(String rawDocumentation,
                              com.sun.javadoc.SourcePosition sp)

tags

public com.sun.javadoc.Tag[] tags()
Returns the sequence of tags representing the tag section of the javadoc comment as set in setRawCommentText.

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

tags

public com.sun.javadoc.Tag[] tags(String tagkind)
Returns the sequence of tags representing all the tags with the given 'kind' in the tag section of the javadoc comment as set in setRawCommentText.

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

tags

public com.sun.javadoc.Tag[] tags(String tagkind,
                                  com.sun.javadoc.Tag[] type)
Returns the sequence of tags representing all the tags with the given 'kind' in the tag section of the javadoc comment as set in setRawCommentText. The type field should be something like 'new MjZZZTag[0]', where MjZZZTag is the class of that represents tags with the given kind. It is used to do the correct casting for the dynamic type of the returned array.


notImplemented

protected void notImplemented(String s)
This is called by derived classes in methods that are not implemented or are not expected to be called. Printing the stack trace helps the debugging. Report instances of this, with enough detail to reproduce the problem.


position

public com.sun.javadoc.SourcePosition position()
Specified by:
position in interface com.sun.javadoc.Doc

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.