Class JType

    • 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 void changePackage​(java.lang.String newPackage)
      Allows subtypes, such as JClass to alter the package to which this JType belongs
      JType createArray()
      Deprecated.
      removed in javasource 1.3rc1, replaced by JArrayType
      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
      • name

        private java.lang.String name
      • _isArray

        private boolean _isArray
      • _componentType

        private JType _componentType
        used for array types
    • Constructor Detail

      • JType

        public 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()
        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 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.