mjc

org.multijava.mjdoc.mjdoc_142
Class MjFieldDoc

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.MjFieldDoc
All Implemented Interfaces:
Comparable, com.sun.javadoc.Doc, com.sun.javadoc.FieldDoc, com.sun.javadoc.MemberDoc, com.sun.javadoc.ProgramElementDoc

public class MjFieldDoc
extends MjMemberDoc
implements com.sun.javadoc.FieldDoc

This class implements the Doclet FieldDoc interface by wrapping the MJC objects corresponding to a field of a class or interface. For classes for which source code is available, this is the JFieldDeclarationType object for the field; if source code is not available, it is only the CField object.

Author:
David R. Cok

Field Summary
private  CField field
          Holder for the CField object (the MJC construct) that this class wraps.
private  JFieldDeclarationType jfield
          Holder for the MJC construct that this class wraps, when source code is available.
private  com.sun.javadoc.Type type
          The type of the field, derived from the CField object.
 
Fields inherited from class org.multijava.mjdoc.mjdoc_142.MjProgramElementDoc
 
Fields inherited from class org.multijava.mjdoc.mjdoc_142.MjDoc
parser
 
Constructor Summary
MjFieldDoc(MjClassDoc container, CField field)
          Constructor of an object wrapping a specific field, used when source code is not available.
MjFieldDoc(MjClassDoc container, JFieldDeclarationType jfield)
          Constructor of an object wrapping a specific field, used when source code is available, since information such as the javadoc comments are available from a JMemberDeclarationType object, but not from a CField object.
 
Method Summary
protected  String compareString()
          Returns a String representation, used for ordering.
 Object constantValue()
          Get the value of a constant field.
 String constantValueExpression()
          Get the value of a constant field.
 boolean isField()
          Returns true because this class represents a field.
 boolean isTransient()
          Returns true if this field is marked transient in the java code.
 boolean isVolatile()
          Returns true if this field is marked volatile in the java code.
 JFieldDeclarationType jfield()
          Returns the wrapped field declaration.
 long longModifiers()
          Returns the modifiers (e.g. public, private, static, final ...) of the field, encoded as bits of a long, as is done in MJC (cf. the Constants in Constants).
 String name()
          The (non-qualified), simple identifier for the field.
 String qualifiedName()
          The fully-qualified name of the field.
 com.sun.javadoc.SerialFieldTag[] serialFieldTags()
          Returns an array of any @serialField tags for this field.
 String toString()
          The (non-qualified), simple identifier for the field.
 com.sun.javadoc.Type type()
          The type of the field, as a doclet object.
 
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, 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, wait, wait, wait
 
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, isIncluded, isInterface, isMethod, isOrdinaryClass, position, seeTags, setRawCommentText, tags, tags
 

Field Detail

jfield

private JFieldDeclarationType jfield
Holder for the MJC construct that this class wraps, when source code is available.


field

private CField field
Holder for the CField object (the MJC construct) that this class wraps.


type

private com.sun.javadoc.Type type
The type of the field, derived from the CField object.

Constructor Detail

MjFieldDoc

public MjFieldDoc(MjClassDoc container,
                  CField field)
Constructor of an object wrapping a specific field, used when source code is not available.

Parameters:
container - the object representing the class that contains this field
field - the MJC construct representing the field

MjFieldDoc

public MjFieldDoc(MjClassDoc container,
                  JFieldDeclarationType jfield)
Constructor of an object wrapping a specific field, used when source code is available, since information such as the javadoc comments are available from a JMemberDeclarationType object, but not from a CField object.

Parameters:
container - the object representing the class that contains this field
jfield - the MJC construct representing the field
Method Detail

name

public String name()
The (non-qualified), simple identifier for the field.

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

toString

public String toString()
The (non-qualified), simple identifier for the field.

Overrides:
toString in class Object

compareString

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

Overrides:
compareString in class MjDoc

type

public com.sun.javadoc.Type type()
The type of the field, as a doclet object.

Specified by:
type in interface com.sun.javadoc.FieldDoc

jfield

public JFieldDeclarationType jfield()
Returns the wrapped field declaration.


isField

public boolean isField()
Returns true because this class represents a field.

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

isTransient

public boolean isTransient()
Returns true if this field is marked transient in the java code.

Specified by:
isTransient in interface com.sun.javadoc.FieldDoc

isVolatile

public boolean isVolatile()
Returns true if this field is marked volatile in the java code.

Specified by:
isVolatile in interface com.sun.javadoc.FieldDoc

serialFieldTags

public com.sun.javadoc.SerialFieldTag[] serialFieldTags()
Returns an array of any @serialField tags for this field.

Specified by:
serialFieldTags in interface com.sun.javadoc.FieldDoc

longModifiers

public long longModifiers()
Returns the modifiers (e.g. public, private, static, final ...) of the field, encoded as bits of a long, as is done in MJC (cf. the Constants in Constants).


qualifiedName

public String qualifiedName()
The fully-qualified name of the field.

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

constantValue

public Object constantValue()
Get the value of a constant field.

Specified by:
constantValue in interface com.sun.javadoc.FieldDoc
Returns:
the value of a constant field. The value is automatically wrapped in an object if it has a primitive type. If the field is not constant, returns null. Added for JDK 1.4 compatability.

constantValueExpression

public String constantValueExpression()
Get the value of a constant field.

Specified by:
constantValueExpression in interface com.sun.javadoc.FieldDoc
Returns:
the text of a Java langauge expression whose value is the value of the. The expression uses no identifiers other than primitive literals. If the field is not constant, returns null. Added for JDK 1.4 compatability.

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.