java.lang.Object
org.codehaus.modello.plugin.java.javasource.JType
Direct Known Subclasses:
JComponentizedType, JStructure

public class JType extends Object
Version:
$Revision$ $Date$
Author:
Keith Visco
  • 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:
      name - the name of the type
  • Method Details

    • createArray

      public final JType createArray()
      Deprecated.
      removed in javasource 1.3rc1, replaced by JArrayType
      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.
      Overrides:
      toString in class Object
      Returns:
      the String representation of this JType
    • 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.