org.exolab.javasource

Class JType

public class JType extends Object

Represents a primitive or class type.

Version: $Revision: 6324 $ $Date: 2006-04-25 15:08:23 -0600 (Tue, 25 Apr 2006) $

Author: Werner Guttmann Keith Visco

Field Summary
static JTypeBOOLEAN
JType for a boolean (Boolean).
static JTypeBYTE
JType instance for a byte (Byte).
static JTypeCHAR
JType instance for a char (Char).
static JTypeDOUBLE
JType instance for a double (Double).
static JTypeFLOAT
JType instance for a float (Float).
static JTypeINT
JType instance for a int (Integer).
static JTypeLONG
JType instance for a long (Long).
static JTypeSHORT
JType instance for a short (Short).
Constructor Summary
protected JType(String name)
Creates a new JType with the given name.
Method Summary
protected voidchangePackage(String newPackage)
Change the package this JType belongs to.
StringgetLocalName()
Returns the unqualified Java type name (i.e. without package).
StringgetName()
Returns the qualified Java type name.
StringgetWrapperName()
Return the name of the wrapper object for a primitive type, null for non-primitive types.
booleanisArray()
Returns true if this type represents an Array.
booleanisPrimitive()
Checks to see if this JType represents a primitive type.
StringtoString()
Returns the String representation of this JType, which is simply the name of this type.

Field Detail

BOOLEAN

public static final JType BOOLEAN
JType for a boolean (Boolean).

BYTE

public static final JType BYTE
JType instance for a byte (Byte).

CHAR

public static final JType CHAR
JType instance for a char (Char).

DOUBLE

public static final JType DOUBLE
JType instance for a double (Double).

FLOAT

public static final JType FLOAT
JType instance for a float (Float).

INT

public static final JType INT
JType instance for a int (Integer).

LONG

public static final JType LONG
JType instance for a long (Long).

SHORT

public static final JType SHORT
JType instance for a short (Short).

Constructor Detail

JType

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

Parameters: name the name of the type

Method Detail

changePackage

protected final void changePackage(String newPackage)
Change the package this JType belongs to. This method is protected to allow 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.

getLocalName

public final String getLocalName()
Returns the unqualified Java type name (i.e. without package).

Returns: the unqualified Java type name.

getName

public final String getName()
Returns the qualified Java type name.

Returns: the qualified Java type name.

getWrapperName

public final String getWrapperName()
Return the name of the wrapper object for a primitive type, null for non-primitive types.

Returns: the name of the wrapper object for a primitive type, null for non-primitive types.

isArray

public boolean isArray()
Returns true if this type represents an Array. Always returns false unless overridden by an extending class.

Returns: true if this type represents an Array.

isPrimitive

public final boolean isPrimitive()
Checks to see if this JType represents a primitive type.

Returns: true if this JType represents a primitive type, 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.

Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com