java.util.Calendar and vice versa.
This class supports multiple date formats. For example, you can define conversions from dates represented by different Strings such as "2001/05/02 and Dec/2013".
The reverse conversion from a Calendar to String (in CalendarConversion#revert(Calendar) will return a formatted String using the date pattern provided in this class constructor
The date patterns must follows the pattern rules of java.
java.text.SimpleDateFormat
| Modifier and Type | Field and Description |
|---|---|
| private final DateConversion |
| Access | Constructor and Description |
|---|---|
| public | CalendarConversion(TimeZone
the timeZone, Locale TimeZone of the given calendar datethe locale, Calendar Locale that determines how the date mask should be formatted.default Calendar value to be returned when the input String is null. Used when valueIfStringIsNull, String ObjectConversion#execute(String) is invoked.default String value to be returned when a Calendar input is null. Used when valueIfObjectIsNull, String... CalendarConversion#revert(Calendar) is invoked.list of acceptable date patterns The first pattern in this sequence will be used to convert a Calendar into a String in dateFormats)CalendarConversion#revert(Calendar).Defines a conversion from String to |
| public | CalendarConversion(Locale
the locale, Calendar Locale that determines how the date mask should be formatted.default Calendar value to be returned when the input String is null. Used when valueIfStringIsNull, String ObjectConversion#execute(String) is invoked.default String value to be returned when a Calendar input is null. Used when valueIfObjectIsNull, String... CalendarConversion#revert(Calendar) is invoked.list of acceptable date patterns The first pattern in this sequence will be used to convert a Calendar into a String in dateFormats)CalendarConversion#revert(Calendar).Defines a conversion from String to |
| public | CalendarConversion(Calendar
default Calendar value to be returned when the input String is null. Used when valueIfStringIsNull, String ObjectConversion#execute(String) is invoked.default String value to be returned when a Calendar input is null. Used when valueIfObjectIsNull, String... CalendarConversion#revert(Calendar) is invoked.list of acceptable date patterns The first pattern in this sequence will be used to convert a Calendar into a String in dateFormats)CalendarConversion#revert(Calendar).Defines a conversion from String to |
| public | CalendarConversion(Locale
the locale, String... Locale that determines how the date mask should be formatted.list of acceptable date patterns The first pattern in this sequence will be used to convert a Calendar into a String in dateFormats)CalendarConversion#revert(Calendar).Defines a conversion from String to |
| public | CalendarConversion(String...
list of acceptable date patterns The first pattern in this sequence will be used to convert a Calendar into a String in dateFormats)CalendarConversion#revert(Calendar).Defines a conversion from String to |
| Modifier and Type | Method and Description |
|---|---|
| protected Calendar | Returns: the Calendar instance containing the date information represented by the given String, or the value ofCalendarConversion#getValueIfStringIsNull() if the String input is null.the String containing a formatted date which must be converted to a Calendar input)Implements abstract com. |
| public SimpleDateFormat[] | getFormatterObjects()
Implements com. |
| public String | Returns: a formatted date String representing the date provided by the given Calendar, or the value ofCalendarConversion#getValueIfObjectIsNull() if the Calendar parameter is null.the Calendar to be converted to a String input)Overrides com. Implements com. |
| dateConversion | back to summary |
|---|---|
| private final DateConversion dateConversion | |
| CalendarConversion | back to summary |
|---|---|
| public CalendarConversion(TimeZone timeZone, Locale locale, Calendar valueIfStringIsNull, String valueIfObjectIsNull, String... dateFormats) Defines a conversion from String to
| |
| CalendarConversion | back to summary |
|---|---|
| public CalendarConversion(Locale locale, Calendar valueIfStringIsNull, String valueIfObjectIsNull, String... dateFormats) Defines a conversion from String to
| |
| CalendarConversion | back to summary |
|---|---|
| public CalendarConversion(Calendar valueIfStringIsNull, String valueIfObjectIsNull, String... dateFormats) Defines a conversion from String to
| |
| CalendarConversion | back to summary |
|---|---|
| public CalendarConversion(Locale locale, String... dateFormats) Defines a conversion from String to
| |
| CalendarConversion | back to summary |
|---|---|
| public CalendarConversion(String... dateFormats) Defines a conversion from String to
| |
| fromString | back to summary |
|---|---|
| protected Calendar fromString(String input) Implements abstract com. Converts a formatted date String to an instance of Calendar. The pattern in the formatted date must match one of the date patterns provided in the constructor of this class.
| |
| getFormatterObjects | back to summary |
|---|---|
| public SimpleDateFormat[] getFormatterObjects() Implements com. Doc from com. Returns the formatter objects
| |
| revert | back to summary |
|---|---|
| public String revert(Calendar input) Overrides com. Implements com. Converts Calendar to a formatted date String. The pattern used to generate the formatted date is the first date pattern provided in the constructor of this class
| |