Package org.joda.time.tz
Class ZoneInfoCompiler
java.lang.Object
org.joda.time.tz.ZoneInfoCompiler
Compiles standard format time zone data files into binary files for each time zone
in the database.
DateTimeZoneBuilder is used to construct and encode
compiled data files. ZoneInfoProvider loads the encoded files and
converts them back into DateTimeZone objects.
Although this tool is similar to zic, the binary formats are not compatible. The latest time zone database files may be obtained here.
ZoneInfoCompiler is mutable and not thread-safe, although the main method may be safely invoked by multiple threads.
- Since:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class(package private) static classprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static Chronology(package private) static ZoneInfoCompiler.DateTimeOfYearprivate Map<String, ZoneInfoCompiler.RuleSet> private List<ZoneInfoCompiler.Zone> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a map of ids to DateTimeZones.(package private) static Chronology(package private) static ZoneInfoCompiler.DateTimeOfYearstatic voidLaunches the ZoneInfoCompiler tool.voidparseDataFile(BufferedReader in, boolean backward) (package private) static intparseDayOfWeek(String str) (package private) static intparseMonth(String str) (package private) static StringparseOptional(String str) (package private) static int(package private) static int(package private) static charparseZoneChar(char c) private static voidprivate static void(package private) static booleantest(String id, DateTimeZone tz) private voidwriteZone(File outputDir, DateTimeZoneBuilder builder, DateTimeZone tz) (package private) static voidwriteZoneInfoMap(DataOutputStream dout, Map<String, DateTimeZone> zimap)
-
Field Details
-
cStartOfYear
-
cLenientISO
-
RULE_LOOKUP
-
ZONE_LOOKUP
-
LINK_LOOKUP
-
MIN_YEAR_LOOKUP
-
MAX_YEAR_LOOKUP
-
ONLY_YEAR_LOOKUP
-
MONTH_LOOKUP
-
DOW_LOOKUP
-
iRuleSets
-
iZones
-
iGoodLinks
-
iBackLinks
-
-
Constructor Details
-
ZoneInfoCompiler
public ZoneInfoCompiler()
-
-
Method Details
-
put
-
expand
-
main
Launches the ZoneInfoCompiler tool.Usage: java org.joda.time.tz.ZoneInfoCompiler <options> <source files> where possible options include: -src <directory> Specify where to read source files -dst <directory> Specify where to write generated files -verbose Output verbosely (default false)
- Throws:
Exception
-
printUsage
private static void printUsage() -
getStartOfYear
-
getLenientISOChronology
-
writeZoneInfoMap
static void writeZoneInfoMap(DataOutputStream dout, Map<String, DateTimeZone> zimap) throws IOException- Parameters:
zimap- maps string ids to DateTimeZone objects.- Throws:
IOException
-
parseYear
-
parseMonth
-
parseDayOfWeek
-
parseOptional
-
parseTime
-
parseZoneChar
static char parseZoneChar(char c) -
test
- Returns:
- false if error.
-
compile
Returns a map of ids to DateTimeZones.- Parameters:
outputDir- optional directory to write compiled data files tosources- optional list of source files to parse- Throws:
IOException
-
writeZone
private void writeZone(File outputDir, DateTimeZoneBuilder builder, DateTimeZone tz) throws IOException - Throws:
IOException
-
parseDataFile
- Throws:
IOException
-