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
private abstract static class FastDateParser.Strategy extends java.lang.Object
A strategy to parse a single field from the parsing pattern
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Strategy()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) abstract boolean
addRegex(FastDateParser parser, java.lang.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, java.util.Calendar cal, java.lang.String value)
Set the Calendar with the parsed field.
-
-
-
Method Detail
-
isNumber
boolean isNumber()
Is this field a number? The default implementation returns false.- Returns:
- true, if field is a number
-
setCalendar
void setCalendar(FastDateParser parser, java.util.Calendar cal, java.lang.String value)
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
abstract boolean addRegex(FastDateParser parser, java.lang.StringBuilder regex)
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
-
-