Package org.fastnate.data.properties
Class DateConverter<D extends Date>
java.lang.Object
org.fastnate.data.properties.FormatConverter<D>
org.fastnate.data.properties.DateConverter<D>
- Type Parameters:
D- the actual date type
- All Implemented Interfaces:
PropertyConverter<D>
Converts a string in an import file file to a date.
Contains the most typical date formats from ISO 8601 and some other worldwide used formats.
To use a custom date format, see
FormatConverter.- Author:
- Tobias Liefke
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new converter with the default formats for the default timezone.DateConverter(TimeZone timeZone) Creates a new instance for a specific timezone. -
Method Summary
Methods inherited from class org.fastnate.data.properties.FormatConverter
getFormats
-
Constructor Details
-
DateConverter
public DateConverter()Creates a new converter with the default formats for the default timezone. -
DateConverter
Creates a new instance for a specific timezone.- Parameters:
timeZone- the time zone to use for _all_ default formats
-
-
Method Details
-
convert
Description copied from interface:PropertyConverterConverts a value from import file to Java.- Specified by:
convertin interfacePropertyConverter<D extends Date>- Overrides:
convertin classFormatConverter<D extends Date>- Parameters:
targetType- the type of the target propertyvalue- the value in the import file- Returns:
- the value in Java
-