Class StringEnumPropertyHandler
- java.lang.Object
-
- org.apache.commons.dbutils.handlers.properties.StringEnumPropertyHandler
-
- All Implemented Interfaces:
PropertyHandler
public class StringEnumPropertyHandler extends java.lang.Object implements PropertyHandler
PropertyHandler
for enums. Will convert strings to enums.
-
-
Constructor Summary
Constructors Constructor Description StringEnumPropertyHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
apply(java.lang.Class<?> parameter, java.lang.Object value)
Do the work required to storevalue
into something of typeparameter
.boolean
match(java.lang.Class<?> parameter, java.lang.Object value)
Test whether thisPropertyHandler
wants to handle settingvalue
into something of typeparameter
.
-
-
-
Method Detail
-
match
public boolean match(java.lang.Class<?> parameter, java.lang.Object value)
Description copied from interface:PropertyHandler
Test whether thisPropertyHandler
wants to handle settingvalue
into something of typeparameter
.- Specified by:
match
in interfacePropertyHandler
- 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
public java.lang.Object apply(java.lang.Class<?> parameter, java.lang.Object value)
Description copied from interface:PropertyHandler
Do the work required to storevalue
into something of typeparameter
. This method is called only if this handler respondedtrue
after a call toPropertyHandler.match(Class, Object)
.- Specified by:
apply
in interfacePropertyHandler
- 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.
-
-