Package org.apache.commons.lang3.time
Class FastDateParser.TimeZoneStrategy
- java.lang.Object
-
- org.apache.commons.lang3.time.FastDateParser.Strategy
-
- org.apache.commons.lang3.time.FastDateParser.PatternStrategy
-
- org.apache.commons.lang3.time.FastDateParser.TimeZoneStrategy
-
- Enclosing class:
- FastDateParser
static class FastDateParser.TimeZoneStrategy extends FastDateParser.PatternStrategy
A strategy that handles a time zone field in the parsing pattern
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classFastDateParser.TimeZoneStrategy.TzInfo
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringGMT_OPTIONprivate static intIDIndex of zone id fromDateFormatSymbols.getZoneStrings().private java.util.Localelocaleprivate static java.lang.StringRFC_822_TIME_ZONEprivate java.util.Map<java.lang.String,FastDateParser.TimeZoneStrategy.TzInfo>tzNamesUsing lower case only or upper case only will cause problems with some Locales like Turkey, Armenia, Colognian and also depending on the Java version.-
Fields inherited from class org.apache.commons.lang3.time.FastDateParser.PatternStrategy
pattern
-
-
Constructor Summary
Constructors Constructor Description TimeZoneStrategy(java.util.Locale locale)Constructs a Strategy that parses a TimeZone.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidsetCalendar(FastDateParser parser, java.util.Calendar calendar, java.lang.String timeZone)(package private) static booleanskipTimeZone(java.lang.String tzId)Tests whether to skip the given time zone, true if TimeZone.getTimeZone().java.lang.StringtoString()Converts this instance to a handy debug string.-
Methods inherited from class org.apache.commons.lang3.time.FastDateParser.PatternStrategy
createPattern, createPattern, isNumber, parse
-
-
-
-
Field Detail
-
RFC_822_TIME_ZONE
private static final java.lang.String RFC_822_TIME_ZONE
- See Also:
- Constant Field Values
-
GMT_OPTION
private static final java.lang.String GMT_OPTION
- See Also:
- Constant Field Values
-
ID
private static final int ID
Index of zone id fromDateFormatSymbols.getZoneStrings().- See Also:
- Constant Field Values
-
locale
private final java.util.Locale locale
-
tzNames
private final java.util.Map<java.lang.String,FastDateParser.TimeZoneStrategy.TzInfo> tzNames
Using lower case only or upper case only will cause problems with some Locales like Turkey, Armenia, Colognian and also depending on the Java version. For details, see https://garygregory.wordpress.com/2015/11/03/java-lowercase-conversion-turkey/
-
-
Method Detail
-
skipTimeZone
static boolean skipTimeZone(java.lang.String tzId)
Tests whether to skip the given time zone, true if TimeZone.getTimeZone().On Java 25 and up, skips short IDs if
ignoreTimeZoneShortIDsis true.This method is package private only for testing.
- Parameters:
tzId- the ID to test.- Returns:
- Whether to skip the given time zone ID.
-
setCalendar
void setCalendar(FastDateParser parser, java.util.Calendar calendar, java.lang.String timeZone)
- Specified by:
setCalendarin classFastDateParser.PatternStrategy
-
toString
public java.lang.String toString()
Converts this instance to a handy debug string.- Overrides:
toStringin classFastDateParser.PatternStrategy- Since:
- 3.12.0
-
-