org.codehaus.modello.generator.java.javasource

Class JType

public class JType extends Object

Version: $Revision: 149 $ $Date: 2004-09-29 13:32:16 -0400 (Wed, 29 Sep 2004) $

Author: Keith Visco

Field Summary
static JTypeBoolean
static JTypeByte
static JTypeChar
static JTypeDouble
static JTypeFloat
static JTypeInt
static JTypeLong
static JTypeShort
Constructor Summary
JType(String name)
Creates a new JType with the given name
Method Summary
protected voidchangePackage(String newPackage)
Allows subtypes, such as JClass to alter the package to which this JType belongs
JTypecreateArray()
Creates a JType Object representing an array of the current JType.
JTypegetComponentType()
If this JType is an array this method will returns the component type of the array, otherwise null will be returned.
StringgetLocalName()
StringgetName()
booleanisArray()
Checks to see if this JType represents an array.
booleanisPrimitive()
Checks to see if this JType represents a primitive
StringtoString()
Returns the String representation of this JType, which is simply the name of this type.

Field Detail

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 Detail

JType

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

Parameters: the name of the type

Method Detail

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

Copyright © 2001-2009 Codehaus. All Rights Reserved.