|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mckoi.database.Caster
public class Caster
Methods to choose and perform casts from database type to Java types.
Field Summary | |
---|---|
static int |
OBJECT_COST
The cost to cast to the closes Java object type. |
static int |
PRIMITIVE_COST
The cost to cast to the closest Java primitive type. |
Constructor Summary | |
---|---|
Caster()
|
Method Summary | |
---|---|
static java.lang.Object[] |
castArgsToConstructor(TObject[] args,
java.lang.reflect.Constructor constructor)
Cast the given arguments to the specified constructors parameter types. |
static void |
deserializeJavaObjects(TObject[] args)
Find any JAVA_OBJECTs in the args and deserialize them into real Java objects. |
static java.lang.reflect.Constructor |
findBestConstructor(java.lang.reflect.Constructor[] constructs,
TObject[] args)
Search for the best constructor that we can use with the given argument types. |
static java.lang.String |
getArgTypesString(TObject[] args)
Get a string giving the database types of all of the arguments. |
static int |
getSqlType(TObject arg)
Get the SQL type for a database argument. |
static int[] |
getSqlTypes(TObject[] args)
Get the SQL types for the given database arguments. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PRIMITIVE_COST
public static final int OBJECT_COST
Constructor Detail |
---|
public Caster()
Method Detail |
---|
public static void deserializeJavaObjects(TObject[] args)
args
- The args to deserialize. Any JAVA_OBJECT args are
converted in-place to a new TObject with a value which is
the deserialized object.public static java.lang.reflect.Constructor findBestConstructor(java.lang.reflect.Constructor[] constructs, TObject[] args)
constructs
- The set of constructors from which to select.argSqlTypes
- The SQL types of the database arguments to be passed
to the constructor.
public static int[] getSqlTypes(TObject[] args)
args
- The database args.
public static int getSqlType(TObject arg)
arg
- The database argument.
public static java.lang.String getArgTypesString(TObject[] args)
args
- The arguments.
public static java.lang.Object[] castArgsToConstructor(TObject[] args, java.lang.reflect.Constructor constructor)
args
- The database arguments from which to cast.constructor
- The constructor to which to cast.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |