com.sun.codemodel
Class JType

java.lang.Object
  extended by com.sun.codemodel.JType
Direct Known Subclasses:
JClass, JPrimitiveType

public abstract class JType
extends java.lang.Object

JType constants and type factories.


Constructor Summary
JType()
           
 
Method Summary
abstract  JClass array()
          Create an array type from this type.
 java.lang.String binaryName()
          Gets the binary name of the type.
 JType elementType()
           
abstract  java.lang.String fullName()
          Gets the full name of the type
 void generate(JFormatter f)
           
 boolean isArray()
          Tell whether or not this is an array type.
 boolean isPrimitive()
          Tell whether or not this is a built-in primitive type, such as int or void.
 boolean isReference()
          Returns true if this is a referenced type.
abstract  java.lang.String name()
          Gets the name of this type.
abstract  JCodeModel owner()
          Gets the owner code model object.
static JPrimitiveType parse(JCodeModel codeModel, java.lang.String typeName)
          Obtains a reference to the primitive type object from a type name.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JType

public JType()
Method Detail

parse

public static JPrimitiveType parse(JCodeModel codeModel,
                                   java.lang.String typeName)
Obtains a reference to the primitive type object from a type name.


owner

public abstract JCodeModel owner()
Gets the owner code model object.


fullName

public abstract java.lang.String fullName()
Gets the full name of the type


binaryName

public java.lang.String binaryName()
Gets the binary name of the type.

See Also:
http://java.sun.com/docs/books/jls/third_edition/html/binaryComp.html#44909

name

public abstract java.lang.String name()
Gets the name of this type.

Returns:
Names like "int", "void", "BigInteger".

array

public abstract JClass array()
Create an array type from this type. This method is undefined for primitive void type, which doesn't have any corresponding array representation.

Returns:
A JType representing the one-dimensional array type whose element type is this type

isArray

public boolean isArray()
Tell whether or not this is an array type.


isPrimitive

public boolean isPrimitive()
Tell whether or not this is a built-in primitive type, such as int or void.


isReference

public final boolean isReference()
Returns true if this is a referenced type.


elementType

public JType elementType()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

generate

public void generate(JFormatter f)