public class Caster extends Object
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
Caster() |
Modifier and Type | Method and Description |
---|---|
static Object[] |
castArgsToConstructor(TObject[] args,
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 Constructor |
findBestConstructor(Constructor[] constructs,
TObject[] args)
Search for the best constructor that we can use with the given
argument types.
|
static 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.
|
public static final int PRIMITIVE_COST
public static final int OBJECT_COST
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 Constructor findBestConstructor(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 String getArgTypesString(TObject[] args)
args
- The arguments.public static Object[] castArgsToConstructor(TObject[] args, Constructor constructor)
args
- The database arguments from which to cast.constructor
- The constructor to which to cast.Copyright © 2015. All rights reserved.