Package org.sqlite.date
Class FastDateParser.Strategy
java.lang.Object
org.sqlite.date.FastDateParser.Strategy
- Direct Known Subclasses:
FastDateParser.CaseInsensitiveTextStrategy
,FastDateParser.CopyQuotedStrategy
,FastDateParser.ISO8601TimeZoneStrategy
,FastDateParser.NumberStrategy
,FastDateParser.TimeZoneStrategy
- Enclosing class:
FastDateParser
A strategy to parse a single field from the parsing pattern
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) abstract boolean
addRegex
(FastDateParser parser, StringBuilder regex) Generate aPattern
regular expression to theStringBuilder
which will accept this field(package private) boolean
isNumber()
Is this field a number? The default implementation returns false.(package private) void
setCalendar
(FastDateParser parser, Calendar cal, String value) Set the Calendar with the parsed field.
-
Constructor Details
-
Strategy
private Strategy()
-
-
Method Details
-
isNumber
boolean isNumber()Is this field a number? The default implementation returns false.- Returns:
- true, if field is a number
-
setCalendar
Set the Calendar with the parsed field.The default implementation does nothing.
- Parameters:
parser
- The parser calling this strategycal
- TheCalendar
to setvalue
- The parsed field to translate and set in cal
-
addRegex
Generate aPattern
regular expression to theStringBuilder
which will accept this field- Parameters:
parser
- The parser calling this strategyregex
- TheStringBuilder
to append to- Returns:
- true, if this field will set the calendar; false, if this field is a constant value
-