org.codehaus.modello.generator.java.javasource

Class JType


public class JType
extends java.lang.Object

Version:
$Revision: 149 $ $Date: 2004-09-29 18:32:16 +0100 (Wed, 29 Sep 2004) $
Author:
Keith Visco

Field Summary

static JType
Boolean
static JType
Byte
static JType
Char
static JType
Double
static JType
Float
static JType
Int
static JType
Long
static JType
Short

Constructor Summary

JType(String name)
Creates a new JType with the given name

Method Summary

protected void
changePackage(String newPackage)
Allows subtypes, such as JClass to alter the package to which this JType belongs
JType
createArray()
Creates a JType Object representing an array of the current JType.
JType
getComponentType()
If this JType is an array this method will returns the component type of the array, otherwise null will be returned.
String
getLocalName()
String
getName()
boolean
isArray()
Checks to see if this JType represents an array.
boolean
isPrimitive()
Checks to see if this JType represents a primitive
String
toString()
Returns the String representation of this JType, which is simply the name of this type.

Field Details

Boolean

public static final JType Boolean

Byte

public static final JType Byte

Char

public static final JType Char

Double

public static final JType Double

Float

public static final JType Float

Int

public static final JType Int

Long

public static final JType Long

Short

public static final JType Short

Constructor Details

JType

public JType(String name)
Creates a new JType with the given name
Parameters:

Method Details

changePackage

protected void changePackage(String newPackage)
Allows subtypes, such as JClass to alter the package to which this JType belongs
Parameters:
newPackage - the new package to which this JType belongs
Note: The package name cannot be changed on a primitive type.

createArray

public final JType createArray()
Creates a JType Object representing an array of the current JType.
Returns:
the new JType which is represents an array.

getComponentType

public JType getComponentType()
If this JType is an array this method will returns the component type of the array, otherwise null will be returned.
Returns:
the component JType if this JType is an array, otherwise null.

getLocalName

public String getLocalName()

getName

public String getName()

isArray

public final boolean isArray()
Checks to see if this JType represents an array.
Returns:
true if this JType represents an array, otherwise false

isPrimitive

public boolean isPrimitive()
Checks to see if this JType represents a primitive
Returns:
true if this JType represents a primitive, otherwise false

toString

public String toString()
Returns the String representation of this JType, which is simply the name of this type.
Returns:
the String representation of this JType