ToDateTokenizer

Emulates Oracle's TO_DATE function. This class knows all about the TO_DATE-format conventions and how to parse the corresponding data.

Methods
static String matchStringOrThrow(Pattern p, ToDateParser params, Enum aEnum)
Match the pattern, or if not possible throw an exception.
static String matchStringOrThrow(Pattern p, ToDateParser params, Enum aEnum)
Match the pattern, or if not possible throw an exception.
Parameters:
p - the pattern
params - the parameters with the input string
aEnum - the pattern name
Returns:
the matched value
static String setByName(ToDateParser params, int field)
Set the given field in the calendar.
static String setByName(ToDateParser params, int field)
Set the given field in the calendar.
Parameters:
params - the parameters with the input string
field - the field to set
Returns:
the matched value
static void throwException(ToDateParser params, String errorStr)
Throw a parse exception.
static void throwException(ToDateParser params, String errorStr)
Throw a parse exception.
Parameters:
params - the parameters with the input string
errorStr - the error string

Fields
static ToDateTokenizer.DayParslet PARSLET_DAY
static ToDateTokenizer.InlineParslet PARSLET_INLINE
static ToDateTokenizer.MonthParslet PARSLET_MONTH
static ToDateTokenizer.TimeParslet PARSLET_TIME
static ToDateTokenizer.YearParslet PARSLET_YEAR
static Pattern PATTERN_AM_PM
static Pattern PATTERN_BC_AD
static Pattern PATTERN_FF
static Pattern PATTERN_FOUR_DIGITS
static Pattern PATTERN_INLINE
static Pattern PATTERN_NUMBER
static Pattern PATTERN_ONE_DIGIT
static Pattern PATTERN_THREE_DIGITS
static Pattern PATTERN_TWO_DIGITS
static Pattern PATTERN_TWO_DIGITS_OR_LESS
static Pattern PATTERN_TWO_TO_FOUR_DIGITS

PARSLET_DAY

The parslet for a day.

PARSLET_INLINE

The inline parslet. E.g. 'YYYY-MM-DD"T"HH24:MI:SS"Z"' where "T" and "Z" are inlined

PARSLET_MONTH

The parslet for a month.

PARSLET_TIME

The parslet for time.

PARSLET_YEAR

The parslet for a year.

PATTERN_AM_PM

The pattern for "am" or "pm".

PATTERN_BC_AD

The pattern for "bc" or "ad".

PATTERN_FF

The pattern for a fraction (of a second for example).

PATTERN_FOUR_DIGITS

The pattern for four digits (typically a year).

PATTERN_INLINE

The pattern for a number.

PATTERN_NUMBER

The pattern for a number.

PATTERN_ONE_DIGIT

The pattern for one digit.

PATTERN_THREE_DIGITS

The pattern for three digits.

PATTERN_TWO_DIGITS

The pattern for two digits.

PATTERN_TWO_DIGITS_OR_LESS

The pattern for one or two digits.

PATTERN_TWO_TO_FOUR_DIGITS

The pattern 2-4 digits (e.g. for RRRR).