/** * Parses the given date in the format specified by * RFC 2822. * <ul> * <li>With strict parsing, obs-* tokens are unsupported. Lenient parsing * supports obs-year and obs-zone, with the exception of the 1-character * military time zones. * <li>The optional CFWS token at the end is not parsed. * <li>RFC 2822 specifies that a zone of "-0000" indicates that the * date-time contains no information about the local time zone. This class * uses the UTC time zone in this case. * </ul> * * @param text the formatted date to be parsed * @param pos the current parse position * @return Date the parsed date. In case of error, returns null. * @since JavaMail 1.2 */ @Override public Date parse(String text, ParsePosition pos) { if (text == null || pos == null) { throw new NullPointerException(); } else if (0 > pos.getIndex() || pos.getIndex() >= text.length()) { return null; } return isLenient() ? new Rfc2822LenientParser(text, pos).parse() : new Rfc2822StrictParser(text, pos).parse(); }
/** * Parses the given date in the format specified by * RFC 2822. * <ul> * <li>With strict parsing, obs-* tokens are unsupported. Lenient parsing * supports obs-year and obs-zone, with the exception of the 1-character * military time zones. * <li>The optional CFWS token at the end is not parsed. * <li>RFC 2822 specifies that a zone of "-0000" indicates that the * date-time contains no information about the local time zone. This class * uses the UTC time zone in this case. * </ul> * * @param text the formatted date to be parsed * @param pos the current parse position * @return Date the parsed date. In case of error, returns null. * @since JavaMail 1.2 */ @Override public Date parse(String text, ParsePosition pos) { if (text == null || pos == null) { throw new NullPointerException(); } else if (0 > pos.getIndex() || pos.getIndex() >= text.length()) { return null; } return isLenient() ? new Rfc2822LenientParser(text, pos).parse() : new Rfc2822StrictParser(text, pos).parse(); }
/** * Parses the given date in the format specified by * RFC 2822. * <ul> * <li>With strict parsing, obs-* tokens are unsupported. Lenient parsing * supports obs-year and obs-zone, with the exception of the 1-character * military time zones. * <li>The optional CFWS token at the end is not parsed. * <li>RFC 2822 specifies that a zone of "-0000" indicates that the * date-time contains no information about the local time zone. This class * uses the UTC time zone in this case. * </ul> * * @param text the formatted date to be parsed * @param pos the current parse position * @return Date the parsed date. In case of error, returns null. * @since JavaMail 1.2 */ @Override public Date parse(String text, ParsePosition pos) { if (text == null || pos == null) { throw new NullPointerException(); } else if (0 > pos.getIndex() || pos.getIndex() >= text.length()) { return null; } return isLenient() ? new Rfc2822LenientParser(text, pos).parse() : new Rfc2822StrictParser(text, pos).parse(); }
/** * Parses the given date in the format specified by * RFC 2822. * <ul> * <li>With strict parsing, obs-* tokens are unsupported. Lenient parsing * supports obs-year and obs-zone, with the exception of the 1-character * military time zones. * <li>The optional CFWS token at the end is not parsed. * <li>RFC 2822 specifies that a zone of "-0000" indicates that the * date-time contains no information about the local time zone. This class * uses the UTC time zone in this case. * </ul> * * @param text the formatted date to be parsed * @param pos the current parse position * @return Date the parsed date. In case of error, returns null. * @since JavaMail 1.2 */ @Override public Date parse(String text, ParsePosition pos) { if (text == null || pos == null) { throw new NullPointerException(); } else if (0 > pos.getIndex() || pos.getIndex() >= text.length()) { return null; } return isLenient() ? new Rfc2822LenientParser(text, pos).parse() : new Rfc2822StrictParser(text, pos).parse(); }
/** * Parses the given date in the format specified by * RFC 2822. * <ul> * <li>With strict parsing, obs-* tokens are unsupported. Lenient parsing * supports obs-year and obs-zone, with the exception of the 1-character * military time zones. * <li>The optional CFWS token at the end is not parsed. * <li>RFC 2822 specifies that a zone of "-0000" indicates that the * date-time contains no information about the local time zone. This class * uses the UTC time zone in this case. * </ul> * * @param text the formatted date to be parsed * @param pos the current parse position * @return Date the parsed date. In case of error, returns null. * @since JavaMail 1.2 */ @Override public Date parse(String text, ParsePosition pos) { if (text == null || pos == null) { throw new NullPointerException(); } else if (0 > pos.getIndex() || pos.getIndex() >= text.length()) { return null; } return isLenient() ? new Rfc2822LenientParser(text, pos).parse() : new Rfc2822StrictParser(text, pos).parse(); }
/** * Parses the given date in the format specified by * RFC 2822. * <ul> * <li>With strict parsing, obs-* tokens are unsupported. Lenient parsing * supports obs-year and obs-zone, with the exception of the 1-character * military time zones. * <li>The optional CFWS token at the end is not parsed. * <li>RFC 2822 specifies that a zone of "-0000" indicates that the * date-time contains no information about the local time zone. This class * uses the UTC time zone in this case. * </ul> * * @param text the formatted date to be parsed * @param pos the current parse position * @return Date the parsed date. In case of error, returns null. * @since JavaMail 1.2 */ @Override public Date parse(String text, ParsePosition pos) { if (text == null || pos == null) { throw new NullPointerException(); } else if (0 > pos.getIndex() || pos.getIndex() >= text.length()) { return null; } return isLenient() ? new Rfc2822LenientParser(text, pos).parse() : new Rfc2822StrictParser(text, pos).parse(); }
/** * Parses the given date in the format specified by * RFC 2822. * <ul> * <li>With strict parsing, obs-* tokens are unsupported. Lenient parsing * supports obs-year and obs-zone, with the exception of the 1-character * military time zones. * <li>The optional CFWS token at the end is not parsed. * <li>RFC 2822 specifies that a zone of "-0000" indicates that the * date-time contains no information about the local time zone. This class * uses the UTC time zone in this case. * </ul> * * @param text the formatted date to be parsed * @param pos the current parse position * @return Date the parsed date. In case of error, returns null. * @since JavaMail 1.2 */ @Override public Date parse(String text, ParsePosition pos) { if (text == null || pos == null) { throw new NullPointerException(); } else if (0 > pos.getIndex() || pos.getIndex() >= text.length()) { return null; } return isLenient() ? new Rfc2822LenientParser(text, pos).parse() : new Rfc2822StrictParser(text, pos).parse(); }
/** * Parses the given date in the format specified by * RFC 2822. * <ul> * <li>With strict parsing, obs-* tokens are unsupported. Lenient parsing * supports obs-year and obs-zone, with the exception of the 1-character * military time zones. * <li>The optional CFWS token at the end is not parsed. * <li>RFC 2822 specifies that a zone of "-0000" indicates that the * date-time contains no information about the local time zone. This class * uses the UTC time zone in this case. * </ul> * * @param text the formatted date to be parsed * @param pos the current parse position * @return Date the parsed date. In case of error, returns null. * @since JavaMail 1.2 */ @Override public Date parse(String text, ParsePosition pos) { if (text == null || pos == null) { throw new NullPointerException(); } else if (0 > pos.getIndex() || pos.getIndex() >= text.length()) { return null; } return isLenient() ? new Rfc2822LenientParser(text, pos).parse() : new Rfc2822StrictParser(text, pos).parse(); }