|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.jbo.domain.TypeFactory
Internal: Applications should not extend this class or invoke its methods.
A utility for creating immutable Domain objects.
Create a Domain object by passing a fully qualified classname and a
compatable data value to a getInstance
method. The classname
may be a expressed as a Class
or as a String
.
. The data value may be an Object
or a value of any of the
primitive data types.
Note that for non-String data types that do not have String constructors or that throw exceptions for empty strings ("") from their constructor or valueOf() methods, this factory assumes the value to be NULL value. So for example if an attribute is of type Number and setAttribute() is called for that attribute with a "" (empty string), the value for the attribute will be set to NULL. This helps all thin-clients to share the same logic of setting NULL values and provide similar behaviour without special-casing for "" strings. This behavior can be overruled by creating a domain for the desired data-type that has a string constructor or a valueOf(String) method that could accept "" (empty string) and convert that to some default value;
Constructor Summary | |
TypeFactory()
|
Method Summary | |
static java.lang.Object |
getInstance(java.lang.Class clazz,
boolean val)
Creates an object of type clazz having the value
val . |
static java.lang.Object |
getInstance(java.lang.Class clazz,
byte val)
Creates an object of type clazz having the value
val . |
static java.lang.Object |
getInstance(java.lang.Class clazz,
char val)
Creates an object of type clazz having the value
val . |
static java.lang.Object |
getInstance(java.lang.Class clazz,
double val)
Creates an object of type clazz having the value
val . |
static java.lang.Object |
getInstance(java.lang.Class clazz,
float val)
Creates an object of type clazz having the value
val . |
static java.lang.Object |
getInstance(java.lang.Class clazz,
int val)
Creates an object of type clazz having the value
val . |
static java.lang.Object |
getInstance(java.lang.Class clazz,
long val)
Creates an object of type clazz having the value
val . |
static java.lang.Object |
getInstance(java.lang.Class clazz,
java.lang.Object val)
Creates an object of type clazz having the value
val . |
static java.lang.Object |
getInstance(java.lang.Class clazz,
short val)
Creates an object of type clazz having the value
val . |
static java.lang.Object |
getInstance(java.lang.String clazz,
boolean val)
Creates an object of type clazz having the value
val . |
static java.lang.Object |
getInstance(java.lang.String clazz,
byte val)
Creates an object of type clazz having the value
val . |
static java.lang.Object |
getInstance(java.lang.String clazz,
char val)
Creates an object of type clazz having the value
val . |
static java.lang.Object |
getInstance(java.lang.String clazz,
double val)
Creates an object of type clazz having the value
val . |
static java.lang.Object |
getInstance(java.lang.String clazz,
float val)
Creates an object of type clazz having the value
val . |
static java.lang.Object |
getInstance(java.lang.String clazz,
int val)
Creates an object of type clazz having the value
val . |
static java.lang.Object |
getInstance(java.lang.String clazz,
long val)
Creates an object of type clazz having the value
val . |
static java.lang.Object |
getInstance(java.lang.String clazz,
java.lang.Object val)
Creates an object of type clazz having the value |
static java.lang.Object |
getInstance(java.lang.String clazz,
short val)
Creates an object of type clazz having the value
val . |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public TypeFactory()
Method Detail |
public static java.lang.Object getInstance(java.lang.Class clazz, java.lang.Object val)
clazz
having the value
val
.clazz
- A fully qualified classname.val
- An object.val
converted to
clazz
. If val
is null
or already of
type clazz
then val
itself is returned.val
is incompatable with
clazz
.public static java.lang.Object getInstance(java.lang.Class clazz, int val)
clazz
having the value
val
.clazz
- A fully qualified classname.val
- A 32-bit signed integer.val
converted to
clazz
.val
is incompatable with
clazz
.public static java.lang.Object getInstance(java.lang.Class clazz, short val)
clazz
having the value
val
.clazz
- A fully qualified classname.val
- A 32-bit signed integer.val
converted to
clazz
.val
is incompatable with
clazz
.public static java.lang.Object getInstance(java.lang.Class clazz, long val)
clazz
having the value
val
.clazz
- A fully qualified classname.val
- A 64-bit signed integer.val
converted to
clazz
.val
is incompatable with
clazz
.public static java.lang.Object getInstance(java.lang.Class clazz, float val)
clazz
having the value
val
.clazz
- A fully qualified classname.val
- A 32-bit floating-point value.val
converted to
clazz
.val
is incompatable with
clazz
.public static java.lang.Object getInstance(java.lang.Class clazz, double val)
clazz
having the value
val
.clazz
- A fully qualified classname.val
- A 64-bit floating-point value.val
converted to
clazz
.val
is incompatable with
clazz
.public static java.lang.Object getInstance(java.lang.Class clazz, byte val)
clazz
having the value
val
.clazz
- A fully qualified classname.val
- An 8-bit signed integer.val
converted to
clazz
.val
is incompatable with
clazz
.public static java.lang.Object getInstance(java.lang.Class clazz, boolean val)
clazz
having the value
val
.clazz
- A fully qualified classname.val
- true
or false
.val
converted to
clazz
.val
is incompatable with
clazz
.public static java.lang.Object getInstance(java.lang.Class clazz, char val)
clazz
having the value
val
.clazz
- A fully qualified classname.val
- A unicode character.val
converted to
clazz
.val
is incompatable with
clazz
.public static java.lang.Object getInstance(java.lang.String clazz, java.lang.Object val)
clazz
having the valueclazz
- A fully qualified classname.
val
.val
- An object.val
converted to
clazz
.val
is incompatable with
clazz
.public static java.lang.Object getInstance(java.lang.String clazz, int val)
clazz
having the value
val
.clazz
- A fully qualified classname.val
- A 32-bit signed integer.val
converted to
clazz
.val
is incompatable with
clazz
.public static java.lang.Object getInstance(java.lang.String clazz, short val)
clazz
having the value
val
.clazz
- A fully qualified classname.val
- A 16-bit signed integer.val
converted to
clazz
.val
is incompatable with
clazz
.public static java.lang.Object getInstance(java.lang.String clazz, long val)
clazz
having the value
val
.clazz
- A fully qualified classname.val
- A 64-bit signed integer.val
converted to
clazz
.val
is incompatable with
clazz
.public static java.lang.Object getInstance(java.lang.String clazz, float val)
clazz
having the value
val
.clazz
- A fully qualified classname.val
- A 32-bit floating-point value.val
converted to
clazz
.val
is incompatable with
clazz
.public static java.lang.Object getInstance(java.lang.String clazz, double val)
clazz
having the value
val
.clazz
- A fully qualified classname.val
- A 64-bit floating-point value.val
converted to
clazz
.val
is incompatable with
clazz
.public static java.lang.Object getInstance(java.lang.String clazz, byte val)
clazz
having the value
val
.clazz
- A fully qualified classname.val
- An 8-bit signed integer.val
converted to
clazz
.val
is incompatable with
clazz
.public static java.lang.Object getInstance(java.lang.String clazz, boolean val)
clazz
having the value
val
.clazz
- A fully qualified classname.val
- true
or false
.val
converted to
clazz
.val
is incompatable with
clazz
.public static java.lang.Object getInstance(java.lang.String clazz, char val)
clazz
having the value
val
.clazz
- A fully qualified classname.val
- A unicode character.val
converted to
clazz
.val
is incompatable with
clazz
.
|
Business Components | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |