public class DatetimeFormatParser extends DateFormatParser
parse(String)
method is responsible for checking the
Progress datetime/datetime-tz format validity.
Also this class provides a set of callback methods,
each callback is called when the corresponding format component is parsed.
By default, all callbacks do nothing, they are expected to be re-defined in subclasses.Modifier and Type | Class and Description |
---|---|
private static interface |
DatetimeFormatParser.Callback
Helper interface used to describe for all component callbacks
|
Constructor and Description |
---|
DatetimeFormatParser() |
Modifier and Type | Method and Description |
---|---|
void |
parse(java.lang.String format)
Parse datetime format, call callbacks while parsing.
|
private static int |
parseComponent(DatetimeFormatParser.Callback cb,
char c,
int fromIdx,
java.lang.String fmt,
int len)
Parse one format component.
|
protected void |
visitAMPM(int startIdx,
int endIdx)
The AM component of the date spec was parsed.
|
protected void |
visitHours(int startIdx,
int endIdx)
The hours component of the date spec was parsed.
|
protected void |
visitMilliseconds(int startIdx,
int endIdx)
The milliseconds component of the date spec was parsed.
|
protected void |
visitMinutes(int startIdx,
int endIdx)
The minutes component of the date spec was parsed.
|
protected void |
visitSeconds(int startIdx,
int endIdx)
The seconds component of the date spec was parsed.
|
protected void |
visitTZHours(int startIdx,
int endIdx)
The hours in timezone component of the date spec was parsed.
|
protected void |
visitTZMinutes(int startIdx,
int endIdx)
The minutes in timezone component of the date spec was parsed.
|
visitDateComponent, visitSep1, visitSep2
protected void visitHours(int startIdx, int endIdx)
startIdx
- the component start index, zero basedendIdx
- the component end index, zero based, exclusive. The end index is
always greater than the start index.protected void visitMinutes(int startIdx, int endIdx)
startIdx
- the component start index, zero basedendIdx
- the component end index, zero based, exclusive. The end index is
always greater than the start index.protected void visitSeconds(int startIdx, int endIdx)
startIdx
- the component start index, zero basedendIdx
- the component end index, zero based, exclusive. The end index is
always greater than the start index.protected void visitMilliseconds(int startIdx, int endIdx)
startIdx
- the component start index, zero basedendIdx
- the component end index, zero based, exclusive. The end index is
always greater than the start index.protected void visitAMPM(int startIdx, int endIdx)
startIdx
- the component start index, zero basedendIdx
- the component end index, zero based, exclusive. The end index is
always greater than the start index.protected void visitTZHours(int startIdx, int endIdx)
startIdx
- the component start index, zero basedendIdx
- the component end index, zero based, exclusive. The end index is
always greater than the start index.protected void visitTZMinutes(int startIdx, int endIdx)
startIdx
- the component start index, zero basedendIdx
- the component end index, zero based, exclusive. The end index is
always greater than the start index.public void parse(java.lang.String format) throws ErrorConditionException
parse
in class DateFormatParser
format
- the format to parseErrorConditionException
- in case the date format is invalidprivate static final int parseComponent(DatetimeFormatParser.Callback cb, char c, int fromIdx, java.lang.String fmt, int len)
cb
- the callback to callc
- the character to skip, in upper casefromIdx
- start indexfmt
- format stringlen
- format length