|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.univocity.parsers.conversions.FormattedDateConversion
public class FormattedDateConversion
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
SimpleDateFormat| Constructor Summary | |
|---|---|
FormattedDateConversion(String format,
Locale locale,
String valueIfObjectIsNull)
|
|
| Method Summary | |
|---|---|
String |
execute(Object input)
Converts a value of type I to a value of type O. |
Object |
revert(String input)
Unsupported operation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FormattedDateConversion(String format,
Locale locale,
String valueIfObjectIsNull)
format - The pattern to be used to convert an input date into a String in execute(Object).locale - the Locale that determines how the date mask should be formatted.valueIfObjectIsNull - default String value to be returned when an input is null . Used when execute(Object) is invoked with a null parameter.| Method Detail |
|---|
public String execute(Object input)
ConversionConvert annotation, this method will perform
the conversion from a parsed input String (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
execute in interface Conversion<Object,String>input - the input of type I to be converted to an object of type O
public Object revert(String input)
revert in interface Conversion<Object,String>input - the input be converted.
UnsupportedOperationException
UnsupportedOperationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||