org.exolab.javasource
Class JType

java.lang.Object
  extended by org.exolab.javasource.JType
Direct Known Subclasses:
JStructure

public class JType
extends java.lang.Object

Represents a primitive or class type

Version:
$Revision: 1.3 $ $Date: 2005/03/05 13:41:59 $
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
protected JType(java.lang.String name)
          Creates a new JType with the given name
 
Method Summary
protected  void changePackage(java.lang.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.
 java.lang.String getLocalName()
           
 java.lang.String getName()
           
 boolean isArray()
          Checks to see if this JType represents an array.
 boolean isPrimitive()
          Checks to see if this JType represents a primitive
 java.lang.String toString()
          Returns the String representation of this JType, which is simply the name of this type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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

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

Parameters:
name - the name of the type
Method Detail

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 java.lang.String getLocalName()

getName

public java.lang.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 java.lang.String toString()
Returns the String representation of this JType, which is simply the name of this type.

Overrides:
toString in class java.lang.Object
Returns:
the String representation of this JType

changePackage

protected void changePackage(java.lang.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.


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