| java.lang.Object com.jidesoft.converter.DateConverter
All known Subclasses: com.jidesoft.converter.CalendarConverter,
DateConverter | public class DateConverter implements ObjectConverter(Code) | | Converter which converts Date to String and converts it back.
|
Constructor Summary | |
public | DateConverter() Creates a DateConverter. |
DateConverter | public DateConverter()(Code) | | Creates a DateConverter.
|
fromString | public Object fromString(String string, ConverterContext context)(Code) | | Converts from a String to a Date.
Parameters: string - the string to be converted. Parameters: context - the context. It could be DATETIME_CONTEXT, DATE_CONTEXT or TIME_CONTEXT. the Date. If the string is null or empty, null will be returned. If the string cannot be parsed as a date, the string itself will be returned. |
getDefaultFormat | public DateFormat getDefaultFormat()(Code) | | Gets DefaultFormat to format an calendar.
DefaultFormat |
setDefaultDatetimeFormat | public void setDefaultDatetimeFormat(DateFormat defaultDatetimeFormat)(Code) | | Sets DefaultDatetimeFormat to format an calendar. This is used
only when context is
DateConverter.DATETIME_CONTEXT .
Parameters: defaultDatetimeFormat - |
setDefaultFormat | public void setDefaultFormat(DateFormat defaultFormat)(Code) | | Sets DefaultFormat to format an calendar.
Parameters: defaultFormat - |
setDefaultTimeFormat | public void setDefaultTimeFormat(DateFormat defaultTimeFormat)(Code) | | Sets DefaultTimeFormat to format an calendar. This is used
only when context is
DateConverter.TIME_CONTEXT .
Parameters: defaultTimeFormat - |
toString | public String toString(Object object, ConverterContext context)(Code) | | Converts the object to String. The object can be a Calendar, a Date or a Number. As long as the DateFormat
can format it correctly, it will be converted to a String. If the object is already a String, we will
return it directly as it is.
Parameters: object - Parameters: context - the string |
|
|