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
A strategy that handles a time zone field in the parsing pattern
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final intIndex of zone id fromDateFormatSymbols.getZoneStrings().private final Localeprivate static final Stringprivate final Map<String,FastDateParser.TimeZoneStrategy.TzInfo> 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.Fields inherited from class org.apache.commons.lang3.time.FastDateParser.PatternStrategy
pattern -
Constructor Summary
ConstructorsConstructorDescriptionTimeZoneStrategy(Locale locale) Constructs a Strategy that parses a TimeZone. -
Method Summary
Modifier and TypeMethodDescription(package private) voidsetCalendar(FastDateParser parser, Calendar calendar, String timeZone) (package private) static booleanskipTimeZone(String tzId) Tests whether to skip the given time zone, true if TimeZone.getTimeZone().toString()Converts this instance to a handy debug string.Methods inherited from class org.apache.commons.lang3.time.FastDateParser.PatternStrategy
createPattern, createPattern, isNumber, parse
-
Field Details
-
RFC_822_TIME_ZONE
- See Also:
-
GMT_OPTION
- See Also:
-
ID
private static final int IDIndex of zone id fromDateFormatSymbols.getZoneStrings().- See Also:
-
locale
-
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/
-
-
Constructor Details
-
TimeZoneStrategy
TimeZoneStrategy(Locale locale) Constructs a Strategy that parses a TimeZone.- Parameters:
locale- The Locale.
-
-
Method Details
-
skipTimeZone
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
- Specified by:
setCalendarin classFastDateParser.PatternStrategy
-
toString
Converts this instance to a handy debug string.- Overrides:
toStringin classFastDateParser.PatternStrategy- Since:
- 3.12.0
-