Package org.apache.commons.dbutils
Interface PropertyHandler
- All Known Implementing Classes:
DatePropertyHandler
,StringEnumPropertyHandler
public interface PropertyHandler
Interface to define how implementations can interact with property handling when constructing a bean from a
ResultSet
. PropertyHandlers do the work of coercing a value into the target type required.-
Method Summary
-
Method Details
-
match
Test whether thisPropertyHandler
wants to handle settingvalue
into something of typeparameter
.- Parameters:
parameter
- The type of the target parameter.value
- The value to be set.- Returns:
- true is this property handler can/wants to handle this value; false otherwise.
-
apply
Do the work required to storevalue
into something of typeparameter
. This method is called only if this handler respondedtrue
after a call tomatch(Class, Object)
.- Parameters:
parameter
- The type of the target parameter.value
- The value to be set.- Returns:
- The converted value or the original value if something doesn't work out.
-