java.lang.Object
com.aoapps.dbc.AutoObjectFactory<T>
- All Implemented Interfaces:
ObjectFactory<T>
,ObjectFactoryE<T,
RuntimeException>
Creates instances of objects by using reflection and passing-in the parameters in the same
order as the matching constructor. For unknown classes, will try to find any
valueOf(int)
or valueOf(String)
methods to create the object instance.- Author:
- AO Industries, Inc.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateObject
(ResultSet result) Creates one object from the current values in the ResultSet.static Method
getValueOfIntMethod
(Class<?> clazz) Gets thevalueOf(int)
for the provided class ornull
if doesn't exist or is non-static or non-public.static Method
getValueOfStringMethod
(Class<?> clazz) Gets thevalueOf(String)
for the provided class ornull
if doesn't exist or is non-static or non-public.boolean
Gets if this object factory can returnnull
fromObjectFactoryE.createObject(java.sql.ResultSet)
.
-
Constructor Details
-
AutoObjectFactory
-
-
Method Details
-
getValueOfIntMethod
Gets thevalueOf(int)
for the provided class ornull
if doesn't exist or is non-static or non-public. -
getValueOfStringMethod
Gets thevalueOf(String)
for the provided class ornull
if doesn't exist or is non-static or non-public. -
createObject
Creates one object from the current values in the ResultSet. Looks for a constructor that is assignable to the prefixParams and the result set values. The constructor must exactly match the number of prefixParams plus the result set.- Specified by:
createObject
in interfaceObjectFactory<T>
- Specified by:
createObject
in interfaceObjectFactoryE<T,
RuntimeException> - Throws:
SQLException
-
isNullable
public boolean isNullable()Gets if this object factory can returnnull
fromObjectFactoryE.createObject(java.sql.ResultSet)
.Note: This is used to enable the
Spliterator.NONNULL
on streams.- Specified by:
isNullable
in interfaceObjectFactoryE<T,
RuntimeException> - Returns:
false
-