public class StringToDateConverter extends Object implements TypeConverter<String,Date>
TypeConverter that converts String values (on the physical layer)
to interpreted Dates.| Constructor and Description |
|---|
StringToDateConverter()
Constructs a new
StringToDateConverter which will use the
TimeComparator.toDate(Object) method for parsing dates and the
DateFormat.MEDIUM date time format for physical representation. |
StringToDateConverter(DateFormat dateFormat)
Constructs a new
StringToDateConverter using a given
DateFormat. |
StringToDateConverter(String datePattern)
Constructs a new
StringToDateConverter using a given date
pattern. |
| Modifier and Type | Method and Description |
|---|---|
String |
toPhysicalValue(Date virtualValue)
Converts a virtual representation of a value into it's physical value.
|
Date |
toVirtualValue(String physicalValue)
Converts a physical value into it's virtual representation.
|
public StringToDateConverter()
StringToDateConverter which will use the
TimeComparator.toDate(Object) method for parsing dates and the
DateFormat.MEDIUM date time format for physical representation.public StringToDateConverter(String datePattern)
StringToDateConverter using a given date
pattern.datePattern - a String date pattern, corresponding to the syntax of a
SimpleDateFormat.public StringToDateConverter(DateFormat dateFormat)
StringToDateConverter using a given
DateFormat.dateFormat - the DateFormat to use for parsing and formatting
dates.public String toPhysicalValue(Date virtualValue)
toPhysicalValue in interface TypeConverter<String,Date>virtualValue - the virtual representationpublic Date toVirtualValue(String physicalValue)
toVirtualValue in interface TypeConverter<String,Date>physicalValue - the physical valueCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.