Package org.apache.commons.dbutils
Interface PropertyHandler
-
- All Known Implementing Classes:
DatePropertyHandler,StringEnumPropertyHandler
public interface PropertyHandlerInterface to define how implementations can interact with property handling when constructing a bean from aResultSet. PropertyHandlers do the work of coercing a value into the target type required.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Objectapply(java.lang.Class<?> parameter, java.lang.Object value)Do the work required to storevalueinto something of typeparameter.booleanmatch(java.lang.Class<?> parameter, java.lang.Object value)Test whether thisPropertyHandlerwants to handle settingvalueinto something of typeparameter.
-
-
-
Method Detail
-
match
boolean match(java.lang.Class<?> parameter, java.lang.Object value)Test whether thisPropertyHandlerwants to handle settingvalueinto 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
java.lang.Object apply(java.lang.Class<?> parameter, java.lang.Object value)Do the work required to storevalueinto something of typeparameter. This method is called only if this handler respondedtrueafter 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.
-
-