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
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateObject(ResultSet result) Creates one object from the current values in the ResultSet.static MethodgetValueOfIntMethod(Class<?> clazz) Gets thevalueOf(int)for the provided class ornullif doesn't exist or is non-static or non-public.static MethodgetValueOfStringMethod(Class<?> clazz) Gets thevalueOf(String)for the provided class ornullif doesn't exist or is non-static or non-public.booleanGets if this object factory can returnnullfromObjectFactoryE.createObject(java.sql.ResultSet).
-
Constructor Details
-
AutoObjectFactory
-
-
Method Details
-
getValueOfIntMethod
Gets thevalueOf(int)for the provided class ornullif doesn't exist or is non-static or non-public. -
getValueOfStringMethod
Gets thevalueOf(String)for the provided class ornullif 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:
createObjectin interfaceObjectFactory<T>- Specified by:
createObjectin interfaceObjectFactoryE<T,RuntimeException> - Throws:
SQLException
-
isNullable
public boolean isNullable()Gets if this object factory can returnnullfromObjectFactoryE.createObject(java.sql.ResultSet).Note: This is used to enable the
Spliterator.NONNULLon streams.- Specified by:
isNullablein interfaceObjectFactoryE<T,RuntimeException> - Returns:
false
-
