Package javax.mail.internet
Class MailDateFormat.AbstractDateParser
- java.lang.Object
-
- javax.mail.internet.MailDateFormat.AbstractDateParser
-
- Direct Known Subclasses:
MailDateFormat.Rfc2822StrictParser
- Enclosing class:
- MailDateFormat
private abstract static class MailDateFormat.AbstractDateParser extends java.lang.ObjectThis class provides the building blocks for date parsing.It has the following invariants:
- no exceptions are thrown, except for java.text.ParseException from parse* methods
- when parse* throws ParseException OR get* returns INVALID_CHAR OR skip* returns false OR peek* is invoked, then pos.getIndex() on method exit is the same as it was on method entry
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static intINVALID_CHAR(package private) static intMAX_YEAR_DIGITS(package private) java.text.ParsePositionpos(package private) java.lang.Stringtext
-
Constructor Summary
Constructors Constructor Description AbstractDateParser(java.lang.String text, java.text.ParsePosition pos)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) intgetAsciiDigit()(package private) intgetChar()(package private) booleanisValidZoneOffset(int offset)(package private) java.util.Dateparse()(package private) intparseAsciiDigits(int count)(package private) intparseAsciiDigits(int min, int max)(package private) intparseAsciiDigits(int min, int max, boolean isEOF)(package private) voidparseChar(char ch)(package private) intparseDayName()(package private) voidparseFoldingWhiteSpace()(package private) intparseMonthName(boolean caseSensitive)(package private) intparseZoneOffset()(package private) booleanpeekAsciiDigit()(package private) booleanpeekChar(char ch)(package private) booleanpeekFoldingWhiteSpace()(package private) booleanskipAlternative(char standard, char alternative)(package private) booleanskipAlternativePair(char firstStandard, char firstAlternative, char secondStandard, char secondAlternative)(package private) booleanskipAlternativeTriple(char firstStandard, char firstAlternative, char secondStandard, char secondAlternative, char thirdStandard, char thirdAlternative)(package private) booleanskipChar(char ch)(package private) booleanskipFoldingWhiteSpace()(package private) booleanskipNewline()(package private) booleanskipPair(char first, char second)(package private) booleanskipWhiteSpace()(package private) abstract java.util.DatetryParse()
-
-
-
Field Detail
-
INVALID_CHAR
static final int INVALID_CHAR
- See Also:
- Constant Field Values
-
MAX_YEAR_DIGITS
static final int MAX_YEAR_DIGITS
- See Also:
- Constant Field Values
-
text
final java.lang.String text
-
pos
final java.text.ParsePosition pos
-
-
Method Detail
-
parse
final java.util.Date parse()
-
tryParse
abstract java.util.Date tryParse() throws java.text.ParseException- Throws:
java.text.ParseException
-
parseDayName
final int parseDayName() throws java.text.ParseException- Returns:
- the java.util.Calendar constant for the parsed day name
- Throws:
java.text.ParseException
-
parseMonthName
final int parseMonthName(boolean caseSensitive) throws java.text.ParseException- Returns:
- the java.util.Calendar constant for the parsed month name
- Throws:
java.text.ParseException
-
parseZoneOffset
final int parseZoneOffset() throws java.text.ParseException- Returns:
- the number of minutes to be added to the time in the local time zone, in order to obtain the equivalent time in the UTC time zone. Returns 0 if the date-time contains no information about the local time zone.
- Throws:
java.text.ParseException
-
isValidZoneOffset
boolean isValidZoneOffset(int offset)
-
parseAsciiDigits
final int parseAsciiDigits(int count) throws java.text.ParseException- Throws:
java.text.ParseException
-
parseAsciiDigits
final int parseAsciiDigits(int min, int max) throws java.text.ParseException- Throws:
java.text.ParseException
-
parseAsciiDigits
final int parseAsciiDigits(int min, int max, boolean isEOF) throws java.text.ParseException- Throws:
java.text.ParseException
-
parseFoldingWhiteSpace
final void parseFoldingWhiteSpace() throws java.text.ParseException- Throws:
java.text.ParseException
-
parseChar
final void parseChar(char ch) throws java.text.ParseException- Throws:
java.text.ParseException
-
getAsciiDigit
final int getAsciiDigit()
-
getChar
final int getChar()
-
skipFoldingWhiteSpace
boolean skipFoldingWhiteSpace()
-
skipWhiteSpace
final boolean skipWhiteSpace()
-
skipNewline
final boolean skipNewline()
-
skipAlternativeTriple
final boolean skipAlternativeTriple(char firstStandard, char firstAlternative, char secondStandard, char secondAlternative, char thirdStandard, char thirdAlternative)
-
skipAlternativePair
final boolean skipAlternativePair(char firstStandard, char firstAlternative, char secondStandard, char secondAlternative)
-
skipAlternative
final boolean skipAlternative(char standard, char alternative)
-
skipPair
final boolean skipPair(char first, char second)
-
skipChar
final boolean skipChar(char ch)
-
peekAsciiDigit
final boolean peekAsciiDigit()
-
peekFoldingWhiteSpace
boolean peekFoldingWhiteSpace()
-
peekChar
final boolean peekChar(char ch)
-
-