Interface ChronoParser<T>
- Type Parameters:
T
- generic type of chronological entity to be parsed
- All Known Implementing Classes:
ChronoFormatter
,MultiFormatParser
Interpretes a text as chronological entity.
- Since:
- 3.0
- Author:
- Meno Hochschild
- See Also:
ChronoEntity
-
Method Summary
Modifier and TypeMethodDescriptiondefault AttributeQuery
Returns the global format attributes which are active if they are not overridden by sectional attributes.default T
parse(CharSequence text)
Interpretes given text as chronological entity starting at the begin of text.default T
parse(CharSequence text, ParseLog status)
Interpretes given text as chronological entity starting at the specified position in parse log.parse(CharSequence text, ParseLog status, AttributeQuery attributes)
Interpretes given text as chronological entity starting at the specified position in parse log.static <T> ChronoParser<T>
Creates a simple placeholder in situations where parsing is not used.
-
Method Details
-
parse
Interpretes given text as chronological entity starting at the begin of text.
- Parameters:
text
- text to be parsed- Returns:
- parse result
- Throws:
IndexOutOfBoundsException
- if the text is emptyParseException
- if the text is not parseable- Since:
- 4.18
-
parse
Interpretes given text as chronological entity starting at the specified position in parse log.
Equivalent to
parse(text, status, getAttributes())
.- Parameters:
text
- text to be parsedstatus
- parser information (always as new instance)- Returns:
- result or
null
if parsing does not work - Throws:
IndexOutOfBoundsException
- if the start position is at end of text or even behind- Since:
- 4.18
-
parse
Interpretes given text as chronological entity starting at the specified position in parse log.
Implementation note: Any implementation will parse the text first at the position
status.getPosition()
and then set the new position in the parse log if successful. In case of error the error index in the parse log will be updated instead.- Parameters:
text
- text to be parsedstatus
- parser information (always as new instance)attributes
- control attributes- Returns:
- result or
null
if parsing does not work - Throws:
IndexOutOfBoundsException
- if the start position is at end of text or even behind
-
getAttributes
Returns the global format attributes which are active if they are not overridden by sectional attributes.
- Returns:
- global control attributes valid for the whole formatter (can be overridden by sectional attributes however)
- Since:
- 4.18
-
unsupported
Creates a simple placeholder in situations where parsing is not used.
- Type Parameters:
T
- generic type of chronological entity to be parsed- Returns:
- dummy parser
- Since:
- 5.9.4
-