public class Caster
extends java.lang.Object
Modifier and Type | Field | 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 | Description |
---|---|
Caster() |
Modifier and Type | Method | Description |
---|---|---|
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.
|
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 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.Copyright © 2018. All rights reserved.