com.borland.jbuilder.jot
Class JotPrimitiveClass

java.lang.Object
  |
  +--com.borland.jbuilder.jot.JotPrimitiveClass
All Implemented Interfaces:
JotClass, JotType

public class JotPrimitiveClass
extends java.lang.Object
implements JotClass, JotType

This class represents Java's primitive types (boolean, char, byte, short, int, long, float, double and void). For more information on primitives, see section 4.2 of the Java Language Specification.


Field Summary
static JotPrimitiveClass booleanType
           
static JotPrimitiveClass byteType
           
static JotPrimitiveClass charType
           
static JotPrimitiveClass doubleType
           
static JotPrimitiveClass floatType
           
static JotPrimitiveClass intType
           
static JotPrimitiveClass longType
           
static JotPrimitiveClass shortType
           
static JotPrimitiveClass voidType
           
 
Method Summary
 void addUserData(java.lang.Object key, java.lang.Object data)
          Allows client supplied data to be associated with this JotClass.
 boolean equals(java.lang.Object that)
           
static JotPrimitiveClass forName(java.lang.String name)
          Get the singleton instance of the JotClass representation for a primitive type.
 JotClass getComponentType()
          This method is not useful when dealing with primitives and always returns null.
 JotConstructor getConstructor(JotClass[] parameterTypes)
          This method is not useful when dealing with primitives and returns null.
 JotConstructor[] getConstructors()
          This method is not useful when dealing with primitives and always returns a zero length array.
 JotConstructor getDeclaredConstructor(JotClass[] parameterTypes)
          This method is not useful when dealing with primitives and returns null.
 JotConstructor[] getDeclaredConstructors()
          This method is not useful when dealing with primitives and always returns a zero length array.
 JotField getDeclaredField(java.lang.String name)
          This method is not useful when dealing with primitives and returns null.
 JotField[] getDeclaredFields()
          This method is not useful when dealing with primitives and always returns a zero length array.
 JotClass[] getDeclaredInnerClasses()
          This method is not useful when dealing with primitives and always returns a zero length array.
 JotMethod getDeclaredMethod(java.lang.String name, JotClass[] parameterTypes)
          This method is not useful when dealing with primitives and returns null.
 JotMethod[] getDeclaredMethods()
          This method is not useful when dealing with primitives and always returns a zero length array.
 JotMethod[] getDeclaredMethods(java.lang.String name)
          This method is not useful when dealing with primitives and always returns a zero length array.
 JotField getField(java.lang.String name)
          This method is not useful when dealing with primitives and returns null.
 JotField[] getFields()
          This method is not useful when dealing with primitives and always returns a zero length array.
 JotFile getFile()
          This method is not useful when dealing with primitives and always returns null.
 JotClass[] getInnerClasses()
          This method is not useful when dealing with primitives and always returns a zero length array.
 JotType[] getInterfaces()
          This method is not useful when dealing with primitives and always returns a zero length array.
 JotClass getJotClass()
          Returns the JotClass object which represents this type.
 JotClassSource getJotClassSource()
          This method is not useful when dealing with primitives and returns null.
 JotMethod getMethod(java.lang.String name, JotClass[] parameterTypes)
          This method is not useful when dealing with primitives and returns null.
 JotMethod[] getMethods()
          This method is not useful when dealing with primitives and always returns a zero length array.
 JotMethod[] getMethods(java.lang.String name)
          This method is not useful when dealing with primitives and always returns a zero length array.
 int getModifiers()
          Returns the Java language modifiers for this class or interface, encoded in an integer.
 java.lang.String getName()
          Returns the fully-qualified name of the type (class, interface, array, or primitive) represented by this JotClass object, as a String.
 JotType getSuperclass()
          This method is not useful when dealing with primitives and always returns null.
 JotType getType()
          Returns a JotType object that refers to this class
 java.lang.Object getUserData(java.lang.Object key)
          Retrieves client data associated with this JotClass.
 int hashCode()
           
 boolean isArray()
          This method is not useful when dealing with primitives and always returns false.
 boolean isAssignableFrom(JotClass cls)
          Informally, this method tests whether the class or interface represented by this JotClass object is either the same as, or is a superclass or superinterface of, the class or interface represented by the specified JotClass parameter.
 boolean isInstance(java.lang.Object obj)
          This method is the dynamic equivalent of the Java language instanceof operator.
 boolean isInterface()
          This method is not useful when dealing with primitives and always returns false.
 boolean isPrimitive()
          Always returns true when invoked on an instance of JotPrimitiveClass.
 java.lang.Object newInstance()
          Attempts to create and initialize a new instance of the class represented by this JotClass object, provided it represents an instantiable class (whether a declared class or an array class).
 void setName(java.lang.String value)
          This method is not used when dealing with primitive data types.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

booleanType

public static final JotPrimitiveClass booleanType

charType

public static final JotPrimitiveClass charType

byteType

public static final JotPrimitiveClass byteType

shortType

public static final JotPrimitiveClass shortType

intType

public static final JotPrimitiveClass intType

longType

public static final JotPrimitiveClass longType

floatType

public static final JotPrimitiveClass floatType

doubleType

public static final JotPrimitiveClass doubleType

voidType

public static final JotPrimitiveClass voidType
Method Detail

forName

public static JotPrimitiveClass forName(java.lang.String name)
Get the singleton instance of the JotClass representation for a primitive type.

getFile

public JotFile getFile()
This method is not useful when dealing with primitives and always returns null.
Specified by:
getFile in interface JotClass

isInstance

public boolean isInstance(java.lang.Object obj)
Description copied from interface: JotClass
This method is the dynamic equivalent of the Java language instanceof operator. The method returns true if the specified Object argument is non-null and can be cast to the reference type represented by this JotClass object without raising a ClassCastException. It returns false otherwise.

Specifically, if this JotClass object represents a declared class, returns true if the specified Object argument is an instance of the represented class (or of any of its subclasses); false otherwise. If this JotClass object represents an array class, returns true if the specified Object argument can be converted to an object of the array type by an identity conversion or by a widening reference conversion; false otherwise. If this JotClass object represents an interface, returns true if the class or any superclass of the specified Object argument implements this interface; false otherwise. If this JotClass object represents a primitive type, returns false.

Specified by:
isInstance in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Parameters:
obj - The object to check

isAssignableFrom

public boolean isAssignableFrom(JotClass cls)
Description copied from interface: JotClass
Informally, this method tests whether the class or interface represented by this JotClass object is either the same as, or is a superclass or superinterface of, the class or interface represented by the specified JotClass parameter.

Specifically, this method tests whether the type represented by the specified JotClass parameter can be converted to the type represented by this JotClass object via an identity conversion or via a widening reference conversion.

See The Java Language Specification, sections 5.1.1 and 5.1.4 for more information.

Specified by:
isAssignableFrom in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Parameters:
cls - the class or interface represented by the JotClass object to be tested

Returns:
true if the JotClass object is either the same as, or is a superclass or superinterface of, the class or interface represented by the specified JotClass parameter. If this JotClass object represents a primitive type, returns true if the specified JotClass parameter is exactly this JotClass object, false otherwise.

Throws:
java.lang.NullPointerException - If the specified JotClass parameter is null.

isInterface

public boolean isInterface()
This method is not useful when dealing with primitives and always returns false.
Specified by:
isInterface in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Returns:
true if it represents an interface.

isPrimitive

public boolean isPrimitive()
Always returns true when invoked on an instance of JotPrimitiveClass.
Specified by:
isPrimitive in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Returns:
true if this JotClass object represents a primitive type.

See Also:
booleanType, charType, byteType, shortType, intType, longType, floatType, doubleType, voidType

isArray

public boolean isArray()
This method is not useful when dealing with primitives and always returns false.
Specified by:
isArray in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Returns:
true if this JotClass object represents an array type.

getComponentType

public JotClass getComponentType()
This method is not useful when dealing with primitives and always returns null.
Specified by:
getComponentType in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
See Also:
java.lang.reflect.Array

getName

public java.lang.String getName()
Description copied from interface: JotClass
Returns the fully-qualified name of the type (class, interface, array, or primitive) represented by this JotClass object, as a String.
Specified by:
getName in interface JotClass

getType

public JotType getType()
Description copied from interface: JotClass
Returns a JotType object that refers to this class
Specified by:
getType in interface JotClass

getModifiers

public int getModifiers()
Description copied from interface: JotClass
Returns the Java language modifiers for this class or interface, encoded in an integer. The valid modifiers for classes consist of the Java Virtual Machine's constants for public, protected, private, final, and interface. They should be decoded using the methods of class Modifier.

The modifier encodings are defined in The Java Virtual Machine Specification, table 4.1.

Specified by:
getModifiers in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
See Also:
Modifier

getSuperclass

public JotType getSuperclass()
This method is not useful when dealing with primitives and always returns null.
Specified by:
getSuperclass in interface JotClass

getInterfaces

public JotType[] getInterfaces()
This method is not useful when dealing with primitives and always returns a zero length array.
Specified by:
getInterfaces in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Returns:
an array of classIDs representing the interfaces of the class or interface represented by this JotClass object. If this JotClass object represents a class that implements no interfaces or if it represents a primitive type this method will return an array of length 0.

getDeclaredFields

public JotField[] getDeclaredFields()
This method is not useful when dealing with primitives and always returns a zero length array.
Specified by:
getDeclaredFields in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Throws:
java.lang.SecurutyException - If access to this information is denied.

See Also:
Field

getDeclaredField

public JotField getDeclaredField(java.lang.String name)
This method is not useful when dealing with primitives and returns null.
Specified by:
getDeclaredField in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Throws:
java.lang.NoSuchFieldException - If a field with the specified name is not found.
java.lang.SecurityException - If access to this information is denied.

See Also:
Field

getFields

public JotField[] getFields()
This method is not useful when dealing with primitives and always returns a zero length array.
Specified by:
getFields in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Throws:
java.lang.SecurityException - If access to this information is denied.

See Also:
Field

getField

public JotField getField(java.lang.String name)
This method is not useful when dealing with primitives and returns null.
Specified by:
getField in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Throws:
java.lang.NoSuchFieldException - If a matching field is not found.
java.lang.SecurityException - If access to the underlying field is denied.

See Also:
Field

getDeclaredMethods

public JotMethod[] getDeclaredMethods()
This method is not useful when dealing with primitives and always returns a zero length array.
Specified by:
getDeclaredMethods in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Throws:
java.lang.SecurityException - If access to this information is denied.

See Also:
Method

getDeclaredMethods

public JotMethod[] getDeclaredMethods(java.lang.String name)
This method is not useful when dealing with primitives and always returns a zero length array.
Specified by:
getDeclaredMethods in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Parameters:
name - is the name of the method sought

Throws:
java.lang.SecurityException - If access to this information is denied.

See Also:
Method

getDeclaredMethod

public JotMethod getDeclaredMethod(java.lang.String name,
                                   JotClass[] parameterTypes)
This method is not useful when dealing with primitives and returns null.
Specified by:
getDeclaredMethod in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Parameters:
name - is a String that specifies the simple name of the desired method
parameterTypes - is an array of JotClass objects that identify the method's formal parameter types, in declared order.

Throws:
java.lang.NoSuchMethodException - If a matching method is not found.
java.lang.SecurityException - If access to the underlying method is denied.

See Also:
Method

getMethods

public JotMethod[] getMethods()
This method is not useful when dealing with primitives and always returns a zero length array.
Specified by:
getMethods in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Throws:
java.lang.SecurityException - if access to this information is denied.

See Also:
Method

getMethods

public JotMethod[] getMethods(java.lang.String name)
This method is not useful when dealing with primitives and always returns a zero length array.
Specified by:
getMethods in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Parameters:
methodName - A string representation of the name of the method sought.

Throws:
java.lang.SecurityException - if access to this information is denied.

See Also:
Method

getMethod

public JotMethod getMethod(java.lang.String name,
                           JotClass[] parameterTypes)
This method is not useful when dealing with primitives and returns null.
Specified by:
getMethod in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Throws:
java.lang.NoSuchMethodException - If a matching method is not found.
java.lang.SecurityException - If access to the underlying method is denied.

See Also:
Method

getDeclaredConstructors

public JotConstructor[] getDeclaredConstructors()
This method is not useful when dealing with primitives and always returns a zero length array.
Specified by:
getDeclaredConstructors in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Throws:
java.lang.SecurityException - If access to this information is denied.

See Also:
Constructor

getDeclaredConstructor

public JotConstructor getDeclaredConstructor(JotClass[] parameterTypes)
This method is not useful when dealing with primitives and returns null.
Specified by:
getDeclaredConstructor in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Throws:
java.lang.NoSuchMethodException - If a matching constructor is not found.
java.lang.SecurityException - If access to the underlying constructor is denied.

See Also:
Constructor

getConstructors

public JotConstructor[] getConstructors()
This method is not useful when dealing with primitives and always returns a zero length array.
Specified by:
getConstructors in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Throws:
java.lang.SecurityException - If access to this information is denied.

See Also:
Constructor

getConstructor

public JotConstructor getConstructor(JotClass[] parameterTypes)
This method is not useful when dealing with primitives and returns null.
Specified by:
getConstructor in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Throws:
java.lang.NoSuchMethodException - If a matching constructor is not found.
java.lang.SecurityException - If access to the underlying constructor is denied.

See Also:
Constructor

addUserData

public void addUserData(java.lang.Object key,
                        java.lang.Object data)
Description copied from interface: JotClass
Allows client supplied data to be associated with this JotClass. The data may be removed by adding the same key and specifying null as the data. >p>
Specified by:
addUserData in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Parameters:
key - an Object which will can be used to identify the data
data - an Object which a Jot client would like associated with this JotClass. If the value is null, then the user data will be removed for this item.

See Also:
getUserData

getUserData

public java.lang.Object getUserData(java.lang.Object key)
Description copied from interface: JotClass
Retrieves client data associated with this JotClass.
Specified by:
getUserData in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Parameters:
key - is the Object which identifies the client data to extract.
Returns:
the Object which is associated with the key or null if no matching data is found.

getDeclaredInnerClasses

public JotClass[] getDeclaredInnerClasses()
This method is not useful when dealing with primitives and always returns a zero length array.
Specified by:
getDeclaredInnerClasses in interface JotClass

getInnerClasses

public JotClass[] getInnerClasses()
This method is not useful when dealing with primitives and always returns a zero length array.
Specified by:
getInnerClasses in interface JotClass

newInstance

public java.lang.Object newInstance()
                             throws java.lang.InstantiationException,
                                    java.lang.IllegalAccessException
Description copied from interface: JotClass
Attempts to create and initialize a new instance of the class represented by this JotClass object, provided it represents an instantiable class (whether a declared class or an array class). If successful, returns the newly created and initialized instance.

Specified by:
newInstance in interface JotClass
Following copied from interface: com.borland.jbuilder.jot.JotClass
Returns:
The new instance of this class.

Throws:
java.lang.InstantiationException - If you try to instantiate an abstract class or an interface or a primitive type, or if the instantiation fails for some other reason.
java.lang.IllegalAccessException - If the class or initializer is not accessible.

getJotClass

public JotClass getJotClass()
Description copied from interface: JotType
Returns the JotClass object which represents this type. If this type is not primitive or an array, and has not been compiled, then returns null.
Specified by:
getJotClass in interface JotType

getJotClassSource

public JotClassSource getJotClassSource()
This method is not useful when dealing with primitives and returns null.
Specified by:
getJotClassSource in interface JotType

setName

public void setName(java.lang.String value)
             throws java.lang.IllegalAccessException
This method is not used when dealing with primitive data types.
Specified by:
setName in interface JotType
Throws:
java.lang.IllegalAccessExcepton - when invoked.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object that)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object