mjc

org.multijava.mjdoc.mjdoc_142
Class MjType

java.lang.Object
  extended byorg.multijava.mjdoc.mjdoc_142.MjType
All Implemented Interfaces:
com.sun.javadoc.Type

public class MjType
extends Object
implements com.sun.javadoc.Type

This class implements the javadoc Doclet Type interface, by wrapping appropriate type objects from the MJ compiler. It can represent the regular java types and also the specialized A@B types used in multi-methods.

Author:
David R. Cok

Field Summary
private  CType baseType
          The type of the dtype object, without any array dimension information.
private static String brackets
          A constant String that is used to print pairs of brackets.
private  CType ctype
          The CType object from MJC that this MjType object wraps.
private  int depth
          The number of array dimensions.
private  CType dtype
          The CType object from MJC that is the dynamic type (in static@dynamic); equal to (==) ctype if this represents a conventional java type.
 
Constructor Summary
MjType(CSpecializedType tt)
          Creates an instance of a javadoc Type object based on the MJC CSpecializedType.
MjType(CType t)
          Creates an instance of a javadoc Type object based on the MJC CType.
 
Method Summary
 com.sun.javadoc.ClassDoc asClassDoc()
          Returns the MjClassDoc object for this type; returns null if the type is primitive; may create a new MjClassDoc object if there is none to represent this reference type.
 String dimension()
          Returns the dimension information, either as a zero-length string or as a String containing pairs of brackets like "[]".
 CType dynamicType()
          Returns the dynamic type of a multi-method specialized type; this is the second in the A@B pair; in a regular java type, A and B are equal.
 boolean isSpecializedType()
          Returns true if this is a specialized type as used in multi-method declarations.
private static String name_nested(CClass c)
          Returns just the class name, with any enclosing classes - no dimensions, no package.
(package private) static String name_noq_dim(CType t)
          Returns the type name without the package but with dimensions.
(package private) static String name_noq_nodim(CType t)
          Returns the type name without the package and without dimensions.
 String qualifiedTypeName()
          Returns the name of the type, including containing classes and its package name, and without the dimension information, all separated by '
 CType staticType()
          Returns the static type of a multi-method specialized type; this is the first in the A@B pair; in a regular java type, A and B are equal.
 String toString()
          Returns the fully-qualified type name, including dimension information.
 String typeName()
          Returns the name of the type, including containing classes, but without package name, and without the dimension information, all separated by '.'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ctype

private CType ctype
The CType object from MJC that this MjType object wraps.


dtype

private CType dtype
The CType object from MJC that is the dynamic type (in static@dynamic); equal to (==) ctype if this represents a conventional java type.


baseType

private CType baseType
The type of the dtype object, without any array dimension information.


depth

private int depth
The number of array dimensions.


brackets

private static final String brackets
A constant String that is used to print pairs of brackets.

Constructor Detail

MjType

public MjType(CType t)
Creates an instance of a javadoc Type object based on the MJC CType.


MjType

public MjType(CSpecializedType tt)
Creates an instance of a javadoc Type object based on the MJC CSpecializedType.

Method Detail

typeName

public String typeName()
Returns the name of the type, including containing classes, but without package name, and without the dimension information, all separated by '.'. This is used at least in writing the parameter types in an HTML page. The result here may not be real useful for specialized types because the first type in A@B will have dimension information and the second will not. In any case, for writing parameter types in method declarations, the html writer does the writing of the two types separately so that it can put html links in on the two types.

Specified by:
typeName in interface com.sun.javadoc.Type

qualifiedTypeName

public String qualifiedTypeName()
Returns the name of the type, including containing classes and its package name, and without the dimension information, all separated by '.'; the first type in A@B will have its dimension information.

Specified by:
qualifiedTypeName in interface com.sun.javadoc.Type

toString

public String toString()
Returns the fully-qualified type name, including dimension information.

Specified by:
toString in interface com.sun.javadoc.Type
Overrides:
toString in class Object

dimension

public String dimension()
Returns the dimension information, either as a zero-length string or as a String containing pairs of brackets like "[]".

Specified by:
dimension in interface com.sun.javadoc.Type

asClassDoc

public com.sun.javadoc.ClassDoc asClassDoc()
Returns the MjClassDoc object for this type; returns null if the type is primitive; may create a new MjClassDoc object if there is none to represent this reference type.

Specified by:
asClassDoc in interface com.sun.javadoc.Type

staticType

public CType staticType()
Returns the static type of a multi-method specialized type; this is the first in the A@B pair; in a regular java type, A and B are equal.


dynamicType

public CType dynamicType()
Returns the dynamic type of a multi-method specialized type; this is the second in the A@B pair; in a regular java type, A and B are equal.


isSpecializedType

public boolean isSpecializedType()
Returns true if this is a specialized type as used in multi-method declarations.


name_noq_nodim

static String name_noq_nodim(CType t)
Returns the type name without the package and without dimensions.


name_noq_dim

static String name_noq_dim(CType t)
Returns the type name without the package but with dimensions.


name_nested

private static String name_nested(CClass c)
Returns just the class name, with any enclosing classes - no dimensions, no package.


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.