Package org.sqlite.date
Class FastDateParser.ISO8601TimeZoneStrategy
java.lang.Object
org.sqlite.date.FastDateParser.Strategy
org.sqlite.date.FastDateParser.ISO8601TimeZoneStrategy
- Enclosing class:
FastDateParser
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final FastDateParser.Strategy
private static final FastDateParser.Strategy
private static final FastDateParser.Strategy
private final String
-
Constructor Summary
ConstructorsConstructorDescriptionISO8601TimeZoneStrategy
(String pattern) Construct a Strategy that parses a TimeZone -
Method Summary
Modifier and TypeMethodDescription(package private) boolean
addRegex
(FastDateParser parser, StringBuilder regex) Generate aPattern
regular expression to theStringBuilder
which will accept this field(package private) static FastDateParser.Strategy
getStrategy
(int tokenLen) Factory method for ISO8601TimeZoneStrategies.(package private) void
setCalendar
(FastDateParser parser, Calendar cal, String value) Set the Calendar with the parsed field.Methods inherited from class org.sqlite.date.FastDateParser.Strategy
isNumber
-
Field Details
-
pattern
-
ISO_8601_1_STRATEGY
-
ISO_8601_2_STRATEGY
-
ISO_8601_3_STRATEGY
-
-
Constructor Details
-
ISO8601TimeZoneStrategy
ISO8601TimeZoneStrategy(String pattern) Construct a Strategy that parses a TimeZone- Parameters:
pattern
- The Pattern
-
-
Method Details
-
addRegex
Generate aPattern
regular expression to theStringBuilder
which will accept this field- Specified by:
addRegex
in classFastDateParser.Strategy
- 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
-
setCalendar
Set the Calendar with the parsed field.The default implementation does nothing.
- Overrides:
setCalendar
in classFastDateParser.Strategy
- Parameters:
parser
- The parser calling this strategycal
- TheCalendar
to setvalue
- The parsed field to translate and set in cal
-
getStrategy
Factory method for ISO8601TimeZoneStrategies.- Parameters:
tokenLen
- a token indicating the length of the TimeZone String to be formatted.- Returns:
- a ISO8601TimeZoneStrategy that can format TimeZone String of length
tokenLen
. If no such strategy exists, an IllegalArgumentException will be thrown.
-