Class FormattedDateConversion
java.lang.Object
com.univocity.parsers.conversions.FormattedDateConversion
- All Implemented Interfaces:
Conversion<Object,String>
Converts objects of different date types (
java.util.Date and java.util.Calendar) to a formatted
date String.
The reverse conversion is not supported.
The date patterns must follow the pattern rules of SimpleDateFormat
- Author:
- Univocity Software Pty Ltd - parsers@univocity.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFormattedDateConversion(String format, Locale locale, String valueIfObjectIsNull) -
Method Summary
-
Constructor Details
-
FormattedDateConversion
- Parameters:
format- The pattern to be used to convert an input date into a String inexecute(Object).locale- theLocalethat determines how the date mask should be formatted.valueIfObjectIsNull- default String value to be returned when an input isnull. Used whenexecute(Object)is invoked with anullparameter.
-
-
Method Details
-
execute
Description copied from interface:ConversionConverts a value of type I to a value of type O. When used in conjunction with theConvertannotation, this method will perform the conversion from a parsed inputString(if no other conversion has been applied before) to a value of the desired type, and the result will be assigned to the annotated field. Note that conversions can be chained so you need to make sure the input type of any previous conversion is compatible with I- Specified by:
executein interfaceConversion<Object,String> - Parameters:
input- the input of type I to be converted to an object of type O- Returns:
- the conversion result.
-
revert
-