Class JType
- java.lang.Object
-
- org.codehaus.modello.plugin.java.javasource.JType
-
- Direct Known Subclasses:
JComponentizedType,JStructure
public class JType extends java.lang.Object- Version:
- $Revision$ $Date$
-
-
Field Summary
Fields Modifier and Type Field Description private JType_componentTypeused for array typesprivate boolean_isArraystatic JTypeBOOLEANstatic JTypeBYTEstatic JTypeCHARstatic JTypeDOUBLEstatic JTypeFLOATstatic JTypeINTstatic JTypeLONGprivate java.lang.Stringnamestatic JTypeSHORT
-
Constructor Summary
Constructors Constructor Description JType(java.lang.String name)Creates a new JType with the given name
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidchangePackage(java.lang.String newPackage)Allows subtypes, such as JClass to alter the package to which this JType belongsJTypecreateArray()Deprecated.removed in javasource 1.3rc1, replaced by JArrayTypeJTypegetComponentType()If this JType is an array this method will returns the component type of the array, otherwise null will be returned.java.lang.StringgetLocalName()java.lang.StringgetName()booleanisArray()Checks to see if this JType represents an array.booleanisPrimitive()Checks to see if this JType represents a primitivejava.lang.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
-
name
private java.lang.String name
-
_isArray
private boolean _isArray
-
_componentType
private JType _componentType
used for array types
-
-
Method Detail
-
createArray
public final JType createArray()
Deprecated.removed in javasource 1.3rc1, replaced by JArrayTypeCreates 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:
toStringin classjava.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.
-
-