diff --git a/docs/embulk-util-timestamp/0.3.0/javadoc/META-INF/LICENSE b/docs/embulk-util-timestamp/0.3.0/javadoc/META-INF/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/docs/embulk-util-timestamp/0.3.0/javadoc/META-INF/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/embulk-util-timestamp/0.3.0/javadoc/META-INF/MANIFEST.MF b/docs/embulk-util-timestamp/0.3.0/javadoc/META-INF/MANIFEST.MF new file mode 100644 index 0000000..58630c0 --- /dev/null +++ b/docs/embulk-util-timestamp/0.3.0/javadoc/META-INF/MANIFEST.MF @@ -0,0 +1,2 @@ +Manifest-Version: 1.0 + diff --git a/docs/embulk-util-timestamp/0.3.0/javadoc/allclasses-frame.html b/docs/embulk-util-timestamp/0.3.0/javadoc/allclasses-frame.html new file mode 100644 index 0000000..f8babae --- /dev/null +++ b/docs/embulk-util-timestamp/0.3.0/javadoc/allclasses-frame.html @@ -0,0 +1,20 @@ + + + +
+ +Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
+Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+Each annotation type has its own separate page with the following sections:
+Each enum has its own separate page with the following sections:
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object
. The interfaces do not inherit from java.lang.Object
.
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+These links take you to the next or previous class, interface, package, or related page.
+These links show and hide the HTML frames. All pages are available with or without frames.
+The All Classes link shows all classes and interfaces except non-static nested types.
+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
+The Constant Field Values page lists the static final fields and their values.
+TimestampFormatter
from the configurations.TimestampFormatter.Builder
from a matching pattern.TimestampFormatter.Builder
from a matching pattern.TimestampFormatter.Builder
from a Java-style matching pattern.TimestampFormatter.Builder
from a Ruby-style matching pattern.static
method to interpret a timezone string
+ in the historical manner of legacy Embulk.Instant
.String
.String
.ZoneId
.ZoneOffset
.TimestampFormatter
instance with configurations.ZoneId
in legacy Embulk's manner.public final class LegacyDateTimeZones +extends Object+
static
method to interpret a timezone string
+ in the historical manner of legacy Embulk.
+
+ Legacy Embulk's org.embulk.spi.time.TimestampParser
starts interpreting a timezone
+ string from Joda-Time's DateTimeFormat
like below. It was before
+ straightforward DateTimeZone#forID
+ and DateTimeZone#getAvailableIDs
.
+
+
DateTimeFormat.forPattern("z").parseMillis("PDT")
+
+ It had been in Embulk since
+
+ v0.1.0
until
+
+ v0.8.20
. GitHub Issue #860
+ describes the details.
+
+
It unfortunately caused some wrong conversions for some American timezones: "EST"
,
+ "EDT"
, "CST"
, "CDT"
, "MST"
, "MDT"
, "PST"
, and
+ "PDT"
. For example, "PDT"
should be recognized as "-07:00"
because
+ "PDT"
was a daylight saving time. But, "PDT"
was actually recognized as
+ "-08:00"
along with "PST"
.
+
+
It was because "PDT"
and "PST"
were aliases of "America/Los_Angeles"
+ in Joda-Time, not aliases of a fixed offset. Joda-Time originally intends to recognize both
+ "PDT"
and "PST"
to be aligned with the date-time with the timezone. For example,
+ "2017-08-20 12:34:56 PST"
goes to "2017-08-20 12:34:56 America/Los_Angeles"
,
+ and this "America/Los_Angeles"
is recognized as "-07:00"
because the date was
+ in the daylight saving time. Same for "2017-08-20 12:34:56 PDT"
. This "PDT"
is
+ eventually recognized as the same "-07:00"
because of the date as well.
+
+
However, DateTimeFormat.forPattern("z").parseMillis("PDT")
was always converted to
+ "-08:00"
because the string, only "PDT"
, does not have any date information.
+ Legacy Embulk never recognized "PDT"
as "-07:00"
even for summer as a result.
+
+
JFYI, the set of special timezones comes from
+
+ DateTimeUtils#buildDefaultTimeZoneNames
.
+
+
Embulk replaced Joda-Time into Java Date and Time API when upgraded
+ to Embulk v0.9. It started to use ZoneId.of
+ instead of DateTimeZone.forId
at that time.
+
+
ZoneId.of(String)
does not recognize "HST"
nor "ROC"
that
+ are recognized by DateTimeZone.forID(String)
.
+
+
Available timezones in Joda-Time are described in + + Joda-Time - Java date and time API - Time Zones.
DateTimeUtils.getDefaultTimeZoneNames()
Modifier and Type | +Method and Description | +
---|---|
static ZoneId |
+toZoneId(String zoneName)
+Converts a timezone string to
+ZoneId in legacy Embulk's manner. |
+
public static ZoneId toZoneId(String zoneName)+
ZoneId
in legacy Embulk's manner.
+
+ It recognizes a timezone string in the following priority. + +
"Z"
is always recognized as UTC in the highest priority.
+ ZoneId.of(String, Map)
+ with a predefined alias map like below for legacy historical reasons.
+ "EST"
is recognized as "-05:00"
.
+ "EDT"
is recognized as "-05:00"
, too.
+ "CST"
is recognized as "-06:00"
.
+ "CDT"
is recognized as "-06:00"
, too.
+ "MST"
is recognized as "-07:00"
.
+ "MDT"
is recognized as "-07:00"
, too.
+ "PST"
is recognized as "-08:00"
.
+ "PDT"
is recognized as "-08:00"
, too.
+ "HST"
is recognized as "-10:00"
.
+ "ROC"
is recognized as the same as "Asia/Taipei"
.
+ null
.
+ Some of its time offset transition (e.g. daylight saving time) can be different from + Embulk's actual historical transitions. But, the difference comes from their tz database + version difference. The difference should be acceptable as users should expect tz database + can be updated anytime.
zoneName
- a timezone stringZoneId
convertedpublic static final class TimestampFormatter.Builder +extends Object+
TimestampFormatter
instance with configurations.Modifier and Type | +Method and Description | +
---|---|
TimestampFormatter |
+build()
+Builds
+TimestampFormatter from the configurations. |
+
TimestampFormatter.Builder |
+setDefaultDate(int defaultYear,
+ int defaultMonthOfYear,
+ int defaultDayOfMonth)
+Sets the default date.
+ |
+
TimestampFormatter.Builder |
+setDefaultDateFromString(String defaultDateString)
+Sets the default date parsed from a
+String . |
+
TimestampFormatter.Builder |
+setDefaultZoneFromString(String defaultZoneString)
+Sets the default timezone parsed from a
+String . |
+
TimestampFormatter.Builder |
+setDefaultZoneId(ZoneId defaultZoneId)
+Sets the default
+ZoneId . |
+
TimestampFormatter.Builder |
+setDefaultZoneOffset(ZoneOffset defaultZoneOffset)
+Sets the default
+ZoneOffset . |
+
public TimestampFormatter.Builder setDefaultZoneOffset(ZoneOffset defaultZoneOffset)+
ZoneOffset
.defaultZoneOffset
- the default ZoneOffset
public TimestampFormatter.Builder setDefaultZoneId(ZoneId defaultZoneId)+
ZoneId
.
+
+ Setting ZoneId
is available only for a legacy non-prefixed matching pattern.
defaultZoneId
- the default ZoneId
IllegalArgumentException
- if called for a prefixed matching patternpublic TimestampFormatter.Builder setDefaultZoneFromString(String defaultZoneString)+
String
.
+
+ Only for a legacy non-prefixed matching pattern, the given String
+ is parsed into ZoneId
, which accepts a geographical region such as
+ "America/Los_Angeles"
and "Asia/Tokyo"
. Remember that timezones based
+ on geographical regions have problems, especially around daylight saving time, as
+ documented in LegacyDateTimeZones
.
+
+
If the pattern is prefix Ruby-style or Java-style, the given String
+ is parsed into ZoneOffset
, which is only a fixed offset. The parse is
+ performed with ZoneOffset.of(String)
.
defaultZoneString
- a String
to be parsed into the default timezoneIllegalArgumentException
- if called for a prefixed matching patternpublic TimestampFormatter.Builder setDefaultDate(int defaultYear, + int defaultMonthOfYear, + int defaultDayOfMonth)+
Setting a default date is available only for a legacy non-prefixed matching pattern.
+ If it is called for a prefixed Ruby-style or Java-style pattern, with a date which is
+ not 1970-01-01, it throws IllegalArgumentException
.
+
+
Calling it for a prefixed pattern is intentionally accepted with 1970-01-01 for
+ easier migration with compatibility from Embulk's own TimestampParser
.
defaultYear
- the default yeardefaultMonthOfYear
- the default month of a year (1-12)defaultDayOfMonth
- the default day of a month (1-31)IllegalArgumentException
- if called for a prefixed matching patternpublic TimestampFormatter.Builder setDefaultDateFromString(String defaultDateString)+
String
.
+
+ Setting a default date is available only for a legacy non-prefixed matching pattern.
+ If it is called for a prefixed Ruby-style or Java-style pattern, with a date which is
+ not 1970-01-01, it throws IllegalArgumentException
.
+
+
Calling it for a prefixed pattern is intentionally accepted with 1970-01-01 for
+ easier migration with compatibility from Embulk's own TimestampParser
.
defaultDateString
- the default date in String ("YYYY-MM-DD"
)IllegalArgumentException
- if called for a prefixed matching patternpublic TimestampFormatter build()+
TimestampFormatter
from the configurations.TimestampFormatter
builtIllegalArgumentException
- if invalidpublic abstract class TimestampFormatter +extends Object+
Instant
, and for formatting Instant
.
+
+ The formatter is built with a predefined format pattern, and used for parsing
+ a date-time String
, and formatting Instant
.
+ Patterns include the Ruby style, the Java style, and the legacy Embulk style
+ ("legacy non-prefixed").
+
+
The Ruby style works like Ruby's
+
+ Time.strptime
and
+
+ Time#strftime
. A Ruby-style pattern follows a prefix
+ "ruby:"
, or built with builderWithRuby(String)
. For example:
+
+
TimestampFormatter formatter1 = TimestampFormatter.builder("ruby:%Y-%m-%d %H:%M:%S %Z").build();
+ Instant instant1 = formatter1.parse("2019-02-28 12:34:56 +09:00");
+ System.out.println(instant1); // => "2019-02-28T03:34:56Z"
+
+ String formatted1 = formatter1.format(Instant.ofEpochSecond(1009110896));
+ System.out.println(formatted1); // => "2017-12-23 12:34:56 UTC"
+
+ // Same as formatter1 without "ruby:".
+ TimestampFormatter formatter2 = TimestampFormatter.builderWithRuby("%Y-%m-%d %H:%M:%S %Z").build();
+
+ The Java style works like DateTimeFormatter
.
+ A Java-style pattern follows a prefix "java:"
, or built with
+ builderWithJava(String)
. For example:
+
+
TimestampFormatter formatter3 = TimestampFormatter.builder("java:uuuu-MM-dd HH:mm:ss XXXXX").build();
+ Instant instant3 = formatter3.parse("2019-02-28 12:34:56 +09:00");
+ System.out.println(instant3); // => "2019-02-28T03:34:56Z"
+
+ String formatted3 = formatter3.format(Instant.ofEpochSecond(1009110896));
+ System.out.println(formatted3); // => "2017-12-23 12:34:56 UTC"
+
+ // Same as formatter3 without "java:".
+ TimestampFormatter formatter4 = TimestampFormatter.builderWithJava("uuuu-MM-dd HH:mm:ss XXXXX").build();
+
+ The legacy Embulk style is here for backward compatibility, but it has
+ some problems in timezones, especially around daylight saving time. A
+ legacy Embulk-style pattern does not have any prefix, and must be built
+ with builder(String, boolean)
with isLegacyEnabled = true
.
+ For example:
+
+
TimestampFormatter formatter5 = TimestampFormatter.builder("%Y-%m-%d %H:%M:%S %Z", true).build();
+ Instant instant5 = formatter5.parse("2019-02-28 12:34:56 +09:00");
+ System.out.println(instant5); // => "2019-02-28T03:34:56Z"
+
+ String formatted5 = formatter5.format(Instant.ofEpochSecond(1009110896));
+ System.out.println(formatted5); // => "2017-12-23 12:34:56 UTC"
Modifier and Type | +Class and Description | +
---|---|
static class |
+TimestampFormatter.Builder
+Builds a
+TimestampFormatter instance with configurations. |
+
Modifier and Type | +Method and Description | +
---|---|
static TimestampFormatter.Builder |
+builder(String pattern)
+Creates a
+TimestampFormatter.Builder from a matching pattern. |
+
static TimestampFormatter.Builder |
+builder(String pattern,
+ boolean isLegacyEnabled)
+Creates a
+TimestampFormatter.Builder from a matching pattern. |
+
static TimestampFormatter.Builder |
+builderWithJava(String pattern)
+Creates a
+TimestampFormatter.Builder from a Java-style matching pattern. |
+
static TimestampFormatter.Builder |
+builderWithRuby(String pattern)
+Creates a
+TimestampFormatter.Builder from a Ruby-style matching pattern. |
+
abstract String |
+format(Instant instant)
+
+ |
+
abstract Instant |
+parse(String text)
+Parses a date-time text into
+Instant . |
+
public static TimestampFormatter.Builder builder(String pattern)+
TimestampFormatter.Builder
from a matching pattern.
+
+ It can create only for a prefixed matching pattern. If a legacy
+ non-prefixed pattern is required, call builder(String, boolean)
+ with isLegacyEnabled = true
.
pattern
- the matching pattern, which must start from "ruby:"
or "java:"
TimestampFormatter.Builder
createdpublic static TimestampFormatter.Builder builder(String pattern, + boolean isLegacyEnabled)+
TimestampFormatter.Builder
from a matching pattern.pattern
- the matching pattern, which may start from "ruby:"
or "java:"
isLegacyEnabled
- true
if a legacy non-prefixed pattern is requiredTimestampFormatter.Builder
createdpublic static TimestampFormatter.Builder builderWithJava(String pattern)+
TimestampFormatter.Builder
from a Java-style matching pattern.
+
+ It builds a Java-style TimestampFormatter
without the prefix "java:"
.
pattern
- the matching pattern, which is Java-style without the prefix "java:"
TimestampFormatter.Builder
createdpublic static TimestampFormatter.Builder builderWithRuby(String pattern)+
TimestampFormatter.Builder
from a Ruby-style matching pattern.
+
+ It builds a Ruby-style TimestampFormatter
without the prefix "ruby:"
.
pattern
- the matching pattern, which is Ruby-style without the prefix "ruby:"
TimestampFormatter.Builder
createdpublic abstract String format(Instant instant)+ +
instant
- the Instant
object to format, not nullNullPointerException
- if instant
is nullDateTimeException
- if an error occurs during formattingpublic abstract Instant parse(String text)+
Instant
.text
- the text to parse, not null nor emptyInstant
, not nullDateTimeParseException
- if unable to parse the requested resultClass | +Description | +
---|---|
LegacyDateTimeZones | +
+ This class contains a
+static method to interpret a timezone string
+ in the historical manner of legacy Embulk. |
+
TimestampFormatter | ++ + | +
TimestampFormatter.Builder | +
+ Builds a
+TimestampFormatter instance with configurations. |
+
Timestamp parser and formatter for Embulk and Embulk plugins
-compile "org.embulk:embulk-util-timestamp:0.2.2"
+compile "org.embulk:embulk-util-timestamp:0.3.0"