Class DatePropertyHandler
- java.lang.Object
-
- org.apache.commons.dbutils.handlers.properties.DatePropertyHandler
-
- All Implemented Interfaces:
PropertyHandler
public class DatePropertyHandler extends java.lang.Object implements PropertyHandler
PropertyHandlerfor date fields. Will convertDate,Time, andTimestampfrom SQL types to java types.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringJAVA_SQL_DATEprivate static java.lang.StringJAVA_SQL_TIMEprivate static java.lang.StringJAVA_SQL_TIMESTAMP
-
Constructor Summary
Constructors Constructor Description DatePropertyHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectapply(java.lang.Class<?> parameter, java.lang.Object value)Stores the givenvalueinto an instance of typeparameter.booleanmatch(java.lang.Class<?> parameter, java.lang.Object value)Tests whether to handle settingvalueinto an instance ofparameter.
-
-
-
Field Detail
-
JAVA_SQL_TIMESTAMP
private static final java.lang.String JAVA_SQL_TIMESTAMP
- See Also:
- Constant Field Values
-
JAVA_SQL_TIME
private static final java.lang.String JAVA_SQL_TIME
- See Also:
- Constant Field Values
-
JAVA_SQL_DATE
private static final java.lang.String JAVA_SQL_DATE
- See Also:
- Constant Field Values
-
-
Method Detail
-
apply
public java.lang.Object apply(java.lang.Class<?> parameter, java.lang.Object value)Description copied from interface:PropertyHandlerStores the givenvalueinto an instance of typeparameter. This method is only called ifPropertyHandler.match(Class, Object)return true.- Specified by:
applyin interfacePropertyHandler- Parameters:
parameter- The type of the target parameter.value- The value to set.- Returns:
- The converted value or the original value if something doesn't work out.
-
match
public boolean match(java.lang.Class<?> parameter, java.lang.Object value)Description copied from interface:PropertyHandlerTests whether to handle settingvalueinto an instance ofparameter.- Specified by:
matchin 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.
-
-