org.objectweb.jonas_ejb.lib
Class JavaType

java.lang.Object
  |
  +--org.objectweb.jonas_ejb.lib.JavaType

public class JavaType
extends java.lang.Object

This class implements methods which permit to get informations about Java Types:


(The Java Type may be or not a primitive type)


Constructor Summary
JavaType()
           
 
Method Summary
static java.lang.String getDefaultValue(java.lang.Class c)
          Returns the default value of the given Java Type.
static java.lang.String getName(java.lang.Class c)
          Returns the name of if the given type
static java.lang.String getSQLGetMethod(java.lang.Class c)
          Returns the name of the getXXX method associated with the given type in java.sql.ResultSet.
static java.lang.String getSQLSetMethod(java.lang.Class c)
          Returns the name of the setXXX method associated with the given type in java.sql.ResultSet.
static java.lang.String getSQLType(java.lang.Class c)
          Returns the SQL Type mapping the given Java Type.
static boolean isSerializable(java.lang.Class c)
          Returns true if the given class is a Serializable Java Type, false otherwise.
static boolean isVoid(java.lang.Class c)
          Returns true if the given type is the type 'void'
static boolean isXxxObjectMethod(java.lang.String name)
          Returns true if the given method name is getObject() or setObject()
static java.lang.Boolean toObject(boolean val)
           
static java.lang.Byte toObject(byte val)
           
static java.lang.Character toObject(char val)
           
static java.lang.Double toObject(double val)
           
static java.lang.Float toObject(float val)
           
static java.lang.Integer toObject(int val)
           
static java.lang.Long toObject(long val)
           
static java.lang.Object toObject(java.lang.Object val)
           
static java.lang.Short toObject(short val)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaType

public JavaType()
Method Detail

isVoid

public static boolean isVoid(java.lang.Class c)
Returns true if the given type is the type 'void'

getName

public static java.lang.String getName(java.lang.Class c)
Returns the name of if the given type

isSerializable

public static boolean isSerializable(java.lang.Class c)
Returns true if the given class is a Serializable Java Type, false otherwise.

getSQLGetMethod

public static java.lang.String getSQLGetMethod(java.lang.Class c)
Returns the name of the getXXX method associated with the given type in java.sql.ResultSet.
Parameters:
class - the class object for a Java type.
Returns:
a string representing the name of the get method, null in error case

getSQLSetMethod

public static java.lang.String getSQLSetMethod(java.lang.Class c)
Returns the name of the setXXX method associated with the given type in java.sql.ResultSet.
Parameters:
class - the class object for a Java type.
Returns:
a string representing the name of the set method, null in error case

isXxxObjectMethod

public static boolean isXxxObjectMethod(java.lang.String name)
Returns true if the given method name is getObject() or setObject()

getSQLType

public static java.lang.String getSQLType(java.lang.Class c)
Returns the SQL Type mapping the given Java Type.
Parameters:
class - the class object for a Java type.
Returns:
the SQL Type mapping the given Java Type, (Types.OTHER in error case)

getDefaultValue

public static java.lang.String getDefaultValue(java.lang.Class c)
Returns the default value of the given Java Type.
Parameters:
class - the class object for a Java type.
Returns:
the default value of the given Java Type

toObject

public static java.lang.Boolean toObject(boolean val)

toObject

public static java.lang.Byte toObject(byte val)

toObject

public static java.lang.Short toObject(short val)

toObject

public static java.lang.Integer toObject(int val)

toObject

public static java.lang.Long toObject(long val)

toObject

public static java.lang.Float toObject(float val)

toObject

public static java.lang.Double toObject(double val)

toObject

public static java.lang.Character toObject(char val)

toObject

public static java.lang.Object toObject(java.lang.Object val)