It uses the JDK java.text.SimpleDateFormat class attemtping the parse using a mask for each one of the possible formats.
| Modifier and Type | Field and Description |
|---|---|
| private static String[] | |
| private static final String[] | masks
The masks used to validate and parse the input to this Atom date. |
| private static final String[] | |
| private static final String[] |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static String | |
| public static String | Returns: the RFC822 represented by the given Date It returns null if it was not possible to parse the date.Date to parse date, final Locale locale)create a RFC822 representation of a date. |
| public static String | Returns: the W3C Date Time represented by the given Date It returns null if it was not possible to parse the date.Date to parse date, final Locale locale)create a W3C Date Time representation of a date. |
| public static Date | Returns: the Date represented by the given W3C date-time string. It returns null if it was not possible to parse the given string into a Date.string to parse for a date. sDate, final Locale locale)Parses a Date out of a String with a date in W3C date-time format or in a RFC822 format. |
| public static Date | Returns: the Date represented by the given RFC822 string. It returns null if it was not possible to parse the given string into a Date.string to parse for a date. sDate, final Locale locale)Parses a Date out of a String with a date in RFC822 format. |
| private static Date | Returns: the Date represented by the given string using one of the given masks. It returns null if it was not possible to parse the the string with any of the masks.array of masks to use for parsing the string masks, String string to parse for a date. sDate, final Locale locale)Parses a Date out of a string using an array of masks. |
| public static Date | Returns: the Date represented by the given W3C date-time string. It returns null if it was not possible to parse the given string into a Date.string to parse for a date. sDate, final Locale locale)Parses a Date out of a String with a date in W3C date-time format. |
| private static String |
| ADDITIONAL_MASKS | back to summary |
|---|---|
| private static String[] ADDITIONAL_MASKS | |
| masks | back to summary |
|---|---|
| private static final String[] masks The masks used to validate and parse the input to this Atom date. These are a lot more forgiving than what the Atom spec allows. The forms that are invalid according to the spec are indicated.
| |
| RFC822_MASKS | back to summary |
|---|---|
| private static final String[] RFC822_MASKS | |
| W3CDATETIME_MASKS | back to summary |
|---|---|
| private static final String[] W3CDATETIME_MASKS | |
| DateParser | back to summary |
|---|---|
| private DateParser() Private constructor to avoid DateParser instances creation. | |
| convertUnsupportedTimeZones | back to summary |
|---|---|
| private static String convertUnsupportedTimeZones(String sDate) | |
| formatRFC822 | back to summary |
|---|---|
| public static String formatRFC822(final Date date, final Locale locale) create a RFC822 representation of a date. Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.
| |
| formatW3CDateTime | back to summary |
|---|---|
| public static String formatW3CDateTime(final Date date, final Locale locale) create a W3C Date Time representation of a date. Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.
| |
| parseDate | back to summary |
|---|---|
| public static Date parseDate(final String sDate, final Locale locale) Parses a Date out of a String with a date in W3C date-time format or in a RFC822 format.
| |
| parseRFC822 | back to summary |
|---|---|
| public static Date parseRFC822(String sDate, final Locale locale) Parses a Date out of a String with a date in RFC822 format. It parsers the following formats:
Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.
| |
| parseUsingMask | back to summary |
|---|---|
| private static Date parseUsingMask(final String[] masks, String sDate, final Locale locale) Parses a Date out of a string using an array of masks. It uses the masks in order until one of them succedes or all fail.
| |
| parseW3CDateTime | back to summary |
|---|---|
| public static Date parseW3CDateTime(String sDate, final Locale locale) Parses a Date out of a String with a date in W3C date-time format. It parsers the following formats:
Refer to the java.text.SimpleDateFormat javadocs for details on the format of each element.
| |
| replaceLastOccurrence | back to summary |
|---|---|
| private static String replaceLastOccurrence(String original, String target, String replacement) | |