Browse Source

Merge pull request #18621 from rmuir/java.time

add java.time packages to painless whitelist
Robert Muir 9 years ago
parent
commit
7c77c62dbc

+ 5 - 0
modules/lang-painless/src/main/java/org/elasticsearch/painless/Definition.java

@@ -43,6 +43,11 @@ public final class Definition {
                       "java.lang.txt",
                       "java.math.txt",
                       "java.text.txt",
+                      "java.time.txt",
+                      "java.time.chrono.txt",
+                      "java.time.format.txt",
+                      "java.time.temporal.txt",
+                      "java.time.zone.txt",
                       "java.util.txt",
                       "java.util.function.txt",
                       "java.util.stream.txt"));

+ 336 - 0
modules/lang-painless/src/main/resources/org/elasticsearch/painless/java.time.chrono.txt

@@ -0,0 +1,336 @@
+#
+# Licensed to Elasticsearch under one or more contributor
+# license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright
+# ownership. Elasticsearch licenses this file to you 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.
+#
+
+#
+# Painless definition file. This defines the hierarchy of classes,
+# what methods and fields they have, etc.
+#
+
+#### Interfaces
+
+class ChronoLocalDate -> java.time.chrono.ChronoLocalDate extends Comparable,Temporal,TemporalAccessor,TemporalAdjuster {
+  ChronoLocalDateTime atTime(LocalTime)
+  boolean equals(Object)
+  String format(DateTimeFormatter)
+  ChronoLocalDate from(TemporalAccessor)
+  Chronology getChronology()
+  Era getEra()
+  int hashCode()
+  boolean isAfter(ChronoLocalDate)
+  boolean isBefore(ChronoLocalDate)
+  boolean isEqual(ChronoLocalDate)
+  boolean isLeapYear()
+  int lengthOfMonth()
+  int lengthOfYear()
+  ChronoLocalDate minus(TemporalAmount)
+  ChronoLocalDate minus(long,TemporalUnit)
+  ChronoLocalDate plus(TemporalAmount)
+  ChronoLocalDate plus(long,TemporalUnit)
+  Comparator timeLineOrder()
+  long toEpochDay()
+  String toString()
+  ChronoPeriod until(ChronoLocalDate)
+  ChronoLocalDate with(TemporalAdjuster)
+  ChronoLocalDate with(TemporalField,long)
+}
+
+class ChronoLocalDateTime -> java.time.chrono.ChronoLocalDateTime extends Comparable,Temporal,TemporalAccessor,TemporalAdjuster {
+  ChronoZonedDateTime atZone(ZoneId)
+  boolean equals(Object)
+  String format(DateTimeFormatter)
+  ChronoLocalDateTime from(TemporalAccessor)
+  int hashCode()
+  boolean isAfter(ChronoLocalDateTime)
+  boolean isBefore(ChronoLocalDateTime)
+  boolean isEqual(ChronoLocalDateTime)
+  Chronology getChronology()
+  ChronoLocalDateTime minus(TemporalAmount)
+  ChronoLocalDateTime minus(long,TemporalUnit)
+  ChronoLocalDateTime plus(TemporalAmount)
+  ChronoLocalDateTime plus(long,TemporalUnit)
+  Comparator timeLineOrder()
+  long toEpochSecond(ZoneOffset)
+  Instant toInstant(ZoneOffset)
+  ChronoLocalDate toLocalDate()
+  LocalTime toLocalTime()
+  String toString()
+  ChronoLocalDateTime with(TemporalAdjuster)
+  ChronoLocalDateTime with(TemporalField,long)
+}
+
+class Chronology -> java.time.chrono.Chronology extends Comparable {
+  ChronoLocalDate date(TemporalAccessor)
+  ChronoLocalDate date(Era,int,int,int)
+  ChronoLocalDate date(int,int,int)
+  ChronoLocalDate dateEpochDay(long)
+  ChronoLocalDate dateNow()
+  ChronoLocalDate dateNow(ZoneId)
+  ChronoLocalDate dateYearDay(Era,int,int)
+  ChronoLocalDate dateYearDay(int,int)
+  boolean equals(Object)
+  Era eraOf(int)
+  List eras()
+  Chronology from(TemporalAccessor)
+  Set getAvailableChronologies()
+  String getDisplayName(TextStyle,Locale)
+  String getId()
+  String getCalendarType()
+  int hashCode()
+  boolean isLeapYear(long)
+  ChronoLocalDateTime localDateTime(TemporalAccessor)
+  Chronology of(String)
+  Chronology ofLocale(Locale)
+  ChronoPeriod period(int,int,int)
+  int prolepticYear(Era,int)
+  ValueRange range(ChronoField)
+  ChronoLocalDate resolveDate(Map,ResolverStyle)
+  String toString()
+  ChronoZonedDateTime zonedDateTime(TemporalAccessor)
+  ChronoZonedDateTime zonedDateTime(Instant,ZoneId)
+}
+
+class ChronoPeriod -> java.time.chrono.ChronoPeriod extends TemporalAmount {
+  ChronoPeriod between(ChronoLocalDate,ChronoLocalDate)
+  boolean equals(Object)
+  Chronology getChronology()
+  List getUnits()
+  int hashCode()
+  boolean isNegative()
+  boolean isZero()
+  ChronoPeriod minus(TemporalAmount)
+  ChronoPeriod multipliedBy(int)
+  ChronoPeriod negated()
+  ChronoPeriod normalized()
+  ChronoPeriod plus(TemporalAmount)
+  String toString()
+}
+
+class ChronoZonedDateTime -> java.time.chrono.ChronoZonedDateTime extends Comparable,Temporal,TemporalAccessor {
+  boolean equals(Object)
+  String format(DateTimeFormatter)
+  ChronoZonedDateTime from(TemporalAccessor)
+  Chronology getChronology()
+  ZoneOffset getOffset()
+  ZoneId getZone()
+  int hashCode()
+  boolean isBefore(ChronoZonedDateTime)
+  boolean isAfter(ChronoZonedDateTime)
+  boolean isEqual(ChronoZonedDateTime)
+  ChronoZonedDateTime minus(TemporalAmount)
+  ChronoZonedDateTime minus(long,TemporalUnit)
+  ChronoZonedDateTime plus(TemporalAmount)
+  ChronoZonedDateTime plus(long,TemporalUnit)
+  Comparator timeLineOrder()
+  Instant toInstant()
+  long toEpochSecond()
+  ChronoLocalDate toLocalDate()
+  LocalTime toLocalTime()
+  ChronoLocalDateTime toLocalDateTime()
+  String toString()
+  ChronoZonedDateTime with(TemporalAdjuster)
+  ChronoZonedDateTime with(TemporalField,long)
+  ChronoZonedDateTime withEarlierOffsetAtOverlap()
+  ChronoZonedDateTime withLaterOffsetAtOverlap()
+  ChronoZonedDateTime withZoneSameLocal(ZoneId)
+  ChronoZonedDateTime withZoneSameInstant(ZoneId)
+}
+
+class Era -> java.time.chrono.Era extends TemporalAccessor,TemporalAdjuster {
+  String getDisplayName(TextStyle,Locale)
+  int getValue()
+}
+
+#### Classes
+
+class AbstractChronology -> java.time.chrono.Chronology extends Comparable,Chronology,Object {
+}
+
+class HijrahChronology -> java.time.chrono.HijrahChronology extends AbstractChronology,Comparable,Chronology,Object {
+  HijrahChronology INSTANCE
+  HijrahDate date(TemporalAccessor)
+  HijrahDate date(int,int,int)
+  HijrahDate date(Era,int,int,int)
+  HijrahDate dateEpochDay(long)
+  HijrahDate dateNow()
+  HijrahDate dateNow(ZoneId)
+  HijrahDate dateYearDay(int,int)
+  HijrahDate dateYearDay(Era,int,int)
+  HijrahEra eraOf(int)
+}
+
+class HijrahDate -> java.time.chrono.HijrahDate extends Comparable,ChronoLocalDate,Temporal,TemporalAccessor,TemporalAdjuster,Object {
+  HijrahDate now()
+  HijrahDate now(ZoneId)
+  HijrahDate of(int,int,int)
+  HijrahDate from(TemporalAccessor)
+  HijrahChronology getChronology()
+  HijrahEra getEra()
+  HijrahDate with(TemporalField,long)
+  HijrahDate with(TemporalAdjuster)
+  HijrahDate withVariant(HijrahChronology)
+  HijrahDate plus(TemporalAmount)
+  HijrahDate minus(TemporalAmount)
+  HijrahDate plus(long,TemporalUnit)
+  HijrahDate minus(long,TemporalUnit)
+}
+
+class IsoChronology -> java.time.chrono.IsoChronology extends AbstractChronology,Comparable,Chronology,Object {
+  IsoChronology INSTANCE
+  LocalDate date(TemporalAccessor)
+  LocalDate date(int,int,int)
+  LocalDate date(Era,int,int,int)
+  LocalDate dateEpochDay(long)
+  LocalDate dateNow()
+  LocalDate dateNow(ZoneId)
+  LocalDate dateYearDay(int,int)
+  LocalDate dateYearDay(Era,int,int)
+  IsoEra eraOf(int)
+}
+
+class JapaneseChronology -> java.time.chrono.JapaneseChronology extends AbstractChronology,Comparable,Chronology,Object {
+  JapaneseChronology INSTANCE
+  JapaneseDate date(TemporalAccessor)
+  JapaneseDate date(int,int,int)
+  JapaneseDate date(Era,int,int,int)
+  JapaneseDate dateEpochDay(long)
+  JapaneseDate dateNow()
+  JapaneseDate dateNow(ZoneId)
+  JapaneseDate dateYearDay(int,int)
+  JapaneseDate dateYearDay(Era,int,int)
+  JapaneseEra eraOf(int)
+}
+
+class JapaneseDate -> java.time.chrono.JapaneseDate extends Comparable,ChronoLocalDate,Temporal,TemporalAccessor,TemporalAdjuster,Object {
+  JapaneseDate now()
+  JapaneseDate now(ZoneId)
+  JapaneseDate of(int,int,int)
+  JapaneseDate from(TemporalAccessor)
+  JapaneseChronology getChronology()
+  JapaneseEra getEra()
+  JapaneseDate with(TemporalField,long)
+  JapaneseDate with(TemporalAdjuster)
+  JapaneseDate plus(TemporalAmount)
+  JapaneseDate minus(TemporalAmount)
+  JapaneseDate plus(long,TemporalUnit)
+  JapaneseDate minus(long,TemporalUnit)
+}
+
+class JapaneseEra -> java.time.chrono.JapaneseEra extends Era,TemporalAccessor,TemporalAdjuster,Object {
+  JapaneseEra HEISEI
+  JapaneseEra MEIJI
+  JapaneseEra SHOWA
+  JapaneseEra TAISHO
+  int getValue()
+  JapaneseEra of(int)
+  JapaneseEra valueOf(String)
+  JapaneseEra[] values()
+}
+
+class MinguoChronology -> java.time.chrono.MinguoChronology extends AbstractChronology,Comparable,Chronology,Object {
+  MinguoChronology INSTANCE
+  MinguoDate date(TemporalAccessor)
+  MinguoDate date(int,int,int)
+  MinguoDate date(Era,int,int,int)
+  MinguoDate dateEpochDay(long)
+  MinguoDate dateNow()
+  MinguoDate dateNow(ZoneId)
+  MinguoDate dateYearDay(int,int)
+  MinguoDate dateYearDay(Era,int,int)
+  MinguoEra eraOf(int)
+}
+
+class MinguoDate -> java.time.chrono.MinguoDate extends Comparable,ChronoLocalDate,Temporal,TemporalAccessor,TemporalAdjuster,Object {
+  MinguoDate now()
+  MinguoDate now(ZoneId)
+  MinguoDate of(int,int,int)
+  MinguoDate from(TemporalAccessor)
+  MinguoChronology getChronology()
+  MinguoEra getEra()
+  MinguoDate with(TemporalField,long)
+  MinguoDate with(TemporalAdjuster)
+  MinguoDate plus(TemporalAmount)
+  MinguoDate minus(TemporalAmount)
+  MinguoDate plus(long,TemporalUnit)
+  MinguoDate minus(long,TemporalUnit)
+}
+
+class ThaiBuddhistChronology -> java.time.chrono.ThaiBuddhistChronology extends AbstractChronology,Comparable,Chronology,Object {
+  ThaiBuddhistChronology INSTANCE
+  ThaiBuddhistDate date(TemporalAccessor)
+  ThaiBuddhistDate date(int,int,int)
+  ThaiBuddhistDate date(Era,int,int,int)
+  ThaiBuddhistDate dateEpochDay(long)
+  ThaiBuddhistDate dateNow()
+  ThaiBuddhistDate dateNow(ZoneId)
+  ThaiBuddhistDate dateYearDay(int,int)
+  ThaiBuddhistDate dateYearDay(Era,int,int)
+  ThaiBuddhistEra eraOf(int)
+}
+
+class ThaiBuddhistDate -> java.time.chrono.ThaiBuddhistDate extends Comparable,ChronoLocalDate,Temporal,TemporalAccessor,TemporalAdjuster,Object {
+  ThaiBuddhistDate now()
+  ThaiBuddhistDate now(ZoneId)
+  ThaiBuddhistDate of(int,int,int)
+  ThaiBuddhistDate from(TemporalAccessor)
+  ThaiBuddhistChronology getChronology()
+  ThaiBuddhistEra getEra()
+  ThaiBuddhistDate with(TemporalField,long)
+  ThaiBuddhistDate with(TemporalAdjuster)
+  ThaiBuddhistDate plus(TemporalAmount)
+  ThaiBuddhistDate minus(TemporalAmount)
+  ThaiBuddhistDate plus(long,TemporalUnit)
+  ThaiBuddhistDate minus(long,TemporalUnit)
+}
+
+#### Enums
+
+class HijrahEra -> java.time.chrono.HijrahEra extends Enum,Comparable,Era,TemporalAccessor,TemporalAdjuster,Object {
+  HijrahEra AH
+  int getValue()
+  HijrahEra of(int)
+  HijrahEra valueOf(String)
+  HijrahEra[] values()
+}
+
+class IsoEra -> java.time.chrono.IsoEra extends Enum,Comparable,Era,TemporalAccessor,TemporalAdjuster,Object {
+  IsoEra BCE
+  IsoEra CE
+  int getValue()
+  IsoEra of(int)
+  IsoEra valueOf(String)
+  IsoEra[] values()
+}
+
+class MinguoEra -> java.time.chrono.MinguoEra extends Enum,Comparable,Era,TemporalAccessor,TemporalAdjuster,Object {
+  MinguoEra BEFORE_ROC
+  MinguoEra ROC
+  int getValue()
+  MinguoEra of(int)
+  MinguoEra valueOf(String)
+  MinguoEra[] values()
+}
+
+class ThaiBuddhistEra -> java.time.chrono.ThaiBuddhistEra extends Enum,Comparable,Era,TemporalAccessor,TemporalAdjuster,Object {
+  ThaiBuddhistEra BE
+  ThaiBuddhistEra BEFORE_BE
+  int getValue()
+  ThaiBuddhistEra of(int)
+  ThaiBuddhistEra valueOf(String)
+  ThaiBuddhistEra[] values()
+}

+ 177 - 0
modules/lang-painless/src/main/resources/org/elasticsearch/painless/java.time.format.txt

@@ -0,0 +1,177 @@
+#
+# Licensed to Elasticsearch under one or more contributor
+# license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright
+# ownership. Elasticsearch licenses this file to you 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.
+#
+
+#
+# Painless definition file. This defines the hierarchy of classes,
+# what methods and fields they have, etc.
+#
+
+#### Classes
+
+class DateTimeFormatter -> java.time.format.DateTimeFormatter extends Object {
+  DateTimeFormatter BASIC_ISO_DATE
+  DateTimeFormatter ISO_DATE
+  DateTimeFormatter ISO_DATE_TIME
+  DateTimeFormatter ISO_INSTANT
+  DateTimeFormatter ISO_LOCAL_DATE
+  DateTimeFormatter ISO_LOCAL_DATE_TIME
+  DateTimeFormatter ISO_LOCAL_TIME
+  DateTimeFormatter ISO_OFFSET_DATE
+  DateTimeFormatter ISO_OFFSET_DATE_TIME
+  DateTimeFormatter ISO_OFFSET_TIME
+  DateTimeFormatter ISO_ORDINAL_DATE
+  DateTimeFormatter ISO_TIME
+  DateTimeFormatter ISO_WEEK_DATE
+  DateTimeFormatter ISO_ZONED_DATE_TIME
+  DateTimeFormatter RFC_1123_DATE_TIME
+  String format(TemporalAccessor)
+  void formatTo(TemporalAccessor,Appendable)
+  Chronology getChronology()
+  DecimalStyle getDecimalStyle()
+  Locale getLocale()
+  Set getResolverFields()
+  ResolverStyle getResolverStyle()
+  ZoneId getZone()
+  DateTimeFormatter ofLocalizedDate(FormatStyle)
+  DateTimeFormatter ofLocalizedDateTime(FormatStyle)
+  DateTimeFormatter ofLocalizedDateTime(FormatStyle,FormatStyle)
+  DateTimeFormatter ofLocalizedTime(FormatStyle)
+  DateTimeFormatter ofPattern(String)
+  DateTimeFormatter ofPattern(String,Locale)
+  TemporalAccessor parse(CharSequence)
+  def parse(CharSequence,TemporalQuery)
+  TemporalAccessor parseBest(CharSequence,TemporalQuery[])
+  TemporalQuery parsedExcessDays()
+  TemporalQuery parsedLeapSecond()
+  TemporalAccessor parseUnresolved(CharSequence,ParsePosition)
+  Format toFormat()
+  Format toFormat(TemporalQuery)
+  DateTimeFormatter withChronology(Chronology)
+  DateTimeFormatter withDecimalStyle(DecimalStyle)
+  DateTimeFormatter withLocale(Locale)
+  DateTimeFormatter withResolverFields(Set)
+  DateTimeFormatter withResolverStyle(ResolverStyle)
+  DateTimeFormatter withZone(ZoneId)
+}
+
+class DateTimeFormatterBuilder -> java.time.format.DateTimeFormatterBuilder extends Object {
+  DateTimeFormatterBuilder <init>()
+  DateTimeFormatterBuilder append(DateTimeFormatter)
+  DateTimeFormatterBuilder appendChronologyId()
+  DateTimeFormatterBuilder appendChronologyText(TextStyle)
+  DateTimeFormatterBuilder appendFraction(TemporalField,int,int,boolean)
+  DateTimeFormatterBuilder appendInstant()
+  DateTimeFormatterBuilder appendInstant(int)
+  DateTimeFormatterBuilder appendLiteral(String)
+  DateTimeFormatterBuilder appendLocalized(FormatStyle,FormatStyle)
+  DateTimeFormatterBuilder appendLocalizedOffset(TextStyle)
+  DateTimeFormatterBuilder appendOffset(String,String)
+  DateTimeFormatterBuilder appendOffsetId()
+  DateTimeFormatterBuilder appendOptional(DateTimeFormatter)
+  DateTimeFormatterBuilder appendPattern(String)
+  DateTimeFormatterBuilder appendText(TemporalField)
+  DateTimeFormatterBuilder appendText(TemporalField,TextStyle)
+  DateTimeFormatterBuilder appendValue(TemporalField)
+  DateTimeFormatterBuilder appendValue(TemporalField,int)
+  DateTimeFormatterBuilder appendValue(TemporalField,int,int,SignStyle)
+  DateTimeFormatterBuilder appendValueReduced(TemporalField,int,int,int)
+  DateTimeFormatterBuilder appendZoneId()
+  DateTimeFormatterBuilder appendZoneOrOffsetId()
+  DateTimeFormatterBuilder appendZoneRegionId()
+  DateTimeFormatterBuilder appendZoneText(TextStyle)
+  DateTimeFormatterBuilder appendZoneText(TextStyle,Set)
+  String getLocalizedDateTimePattern(FormatStyle,FormatStyle,Chronology,Locale)
+  DateTimeFormatterBuilder optionalEnd()
+  DateTimeFormatterBuilder optionalStart()
+  DateTimeFormatterBuilder padNext(int)
+  DateTimeFormatterBuilder padNext(int,char)
+  DateTimeFormatterBuilder parseCaseInsensitive()
+  DateTimeFormatterBuilder parseCaseSensitive()
+  DateTimeFormatterBuilder parseDefaulting(TemporalField,long)
+  DateTimeFormatterBuilder parseLenient()
+  DateTimeFormatterBuilder parseStrict()
+  DateTimeFormatter toFormatter()
+  DateTimeFormatter toFormatter(Locale)
+}
+
+class DecimalStyle -> java.time.format.DecimalStyle extends Object {
+  DecimalStyle STANDARD
+  Set getAvailableLocales()
+  char getDecimalSeparator()
+  char getNegativeSign()
+  char getPositiveSign()
+  char getZeroDigit()
+  DecimalStyle of(Locale)
+  DecimalStyle ofDefaultLocale()
+  DecimalStyle withDecimalSeparator(char)
+  DecimalStyle withNegativeSign(char)
+  DecimalStyle withPositiveSign(char)
+  DecimalStyle withZeroDigit(char)
+}
+
+#### Enums
+
+class FormatStyle -> java.time.format.FormatStyle extends Enum,Comparable,Object {
+  FormatStyle FULL
+  FormatStyle LONG
+  FormatStyle MEDIUM
+  FormatStyle SHORT
+  FormatStyle valueOf(String)
+  FormatStyle[] values()
+}
+
+class ResolverStyle -> java.time.format.ResolverStyle extends Enum,Comparable,Object {
+  ResolverStyle LENIENT
+  ResolverStyle SMART
+  ResolverStyle STRICT
+  ResolverStyle valueOf(String)
+  ResolverStyle[] values()
+}
+
+class SignStyle -> java.time.format.SignStyle extends Enum,Comparable,Object {
+  SignStyle ALWAYS
+  SignStyle EXCEEDS_PAD
+  SignStyle NEVER
+  SignStyle NORMAL
+  SignStyle NOT_NEGATIVE
+  SignStyle valueOf(String)
+  SignStyle[] values()
+}
+
+class TextStyle -> java.time.format.TextStyle extends Enum,Comparable,Object {
+  TextStyle FULL
+  TextStyle FULL_STANDALONE
+  TextStyle NARROW
+  TextStyle NARROW_STANDALONE
+  TextStyle SHORT
+  TextStyle SHORT_STANDALONE
+  TextStyle asNormal()
+  TextStyle asStandalone()
+  boolean isStandalone()
+  TextStyle valueOf(String)
+  TextStyle[] values()
+}
+
+#### Exceptions
+
+class DateTimeParseException -> java.time.format.DateTimeParseException extends DateTimeException,RuntimeException,Exception,Object {
+  DateTimeParseException <init>(String,CharSequence,int)
+  int getErrorIndex()
+  String getParsedString()
+}

+ 225 - 0
modules/lang-painless/src/main/resources/org/elasticsearch/painless/java.time.temporal.txt

@@ -0,0 +1,225 @@
+#
+# Licensed to Elasticsearch under one or more contributor
+# license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright
+# ownership. Elasticsearch licenses this file to you 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.
+#
+
+#
+# Painless definition file. This defines the hierarchy of classes,
+# what methods and fields they have, etc.
+#
+
+#### Interfaces
+
+class Temporal -> java.time.temporal.Temporal extends TemporalAccessor {
+  Temporal minus(long,TemporalUnit)
+  Temporal minus(TemporalAmount)
+  Temporal plus(long,TemporalUnit)
+  Temporal plus(TemporalAmount)
+  long until(Temporal,TemporalUnit)
+  Temporal with(TemporalAdjuster)
+  Temporal with(TemporalField,long)
+}
+
+class TemporalAccessor -> java.time.temporal.TemporalAccessor {
+  int get(TemporalField)
+  long getLong(TemporalField)
+  boolean isSupported(TemporalField)
+  def query(TemporalQuery)
+  ValueRange range(TemporalField)
+}
+
+class TemporalAdjuster -> java.time.temporal.TemporalAdjuster {
+  Temporal adjustInto(Temporal)
+}
+
+class TemporalAmount -> java.time.temporal.TemporalAmount {
+  Temporal addTo(Temporal)
+  long get(TemporalUnit)
+  List getUnits()
+  Temporal subtractFrom(Temporal)
+}
+
+class TemporalField -> java.time.temporal.TemporalField {
+  Temporal adjustInto(Temporal,long)
+  TemporalUnit getBaseUnit()
+  String getDisplayName(Locale)
+  long getFrom(TemporalAccessor)
+  TemporalUnit getRangeUnit()
+  boolean isDateBased()
+  boolean isSupportedBy(TemporalAccessor)
+  boolean isTimeBased()
+  ValueRange range()
+  ValueRange rangeRefinedBy(TemporalAccessor)
+  TemporalAccessor resolve(Map,TemporalAccessor,ResolverStyle)
+  String toString()
+}
+
+class TemporalQuery -> java.time.temporal.TemporalQuery {
+  def queryFrom(TemporalAccessor)
+}
+
+class TemporalUnit -> java.time.temporal.TemporalUnit {
+  Temporal addTo(Temporal,long)
+  long between(Temporal,Temporal)
+  Duration getDuration()
+  boolean isDateBased()
+  boolean isDurationEstimated()
+  boolean isSupportedBy(Temporal)
+  boolean isTimeBased()
+  String toString()
+}
+
+#### Classes
+
+class IsoFields -> java.time.temporal.IsoFields extends Object {
+  TemporalField DAY_OF_QUARTER
+  TemporalField QUARTER_OF_YEAR
+  TemporalUnit QUARTER_YEARS
+  TemporalField WEEK_BASED_YEAR
+  TemporalUnit WEEK_BASED_YEARS
+  TemporalField WEEK_OF_WEEK_BASED_YEAR
+}
+
+class JulianFields -> java.time.temporal.JulianFields extends Object {
+  TemporalField JULIAN_DAY
+  TemporalField MODIFIED_JULIAN_DAY
+  TemporalField RATA_DIE
+}
+
+class TemporalAdjusters -> java.time.temporal.TemporalAdjusters extends Object {
+  TemporalAdjuster dayOfWeekInMonth(int,DayOfWeek)
+  TemporalAdjuster firstDayOfMonth()
+  TemporalAdjuster firstDayOfNextMonth()
+  TemporalAdjuster firstDayOfNextYear()
+  TemporalAdjuster firstDayOfYear()
+  TemporalAdjuster firstInMonth(DayOfWeek)
+  TemporalAdjuster lastDayOfMonth()
+  TemporalAdjuster lastDayOfYear()
+  TemporalAdjuster lastInMonth(DayOfWeek)
+  TemporalAdjuster next(DayOfWeek)
+  TemporalAdjuster nextOrSame(DayOfWeek)
+  TemporalAdjuster ofDateAdjuster(UnaryOperator)
+  TemporalAdjuster previous(DayOfWeek)
+  TemporalAdjuster previousOrSame(DayOfWeek)
+}
+
+class TemporalQueries -> java.time.temporal.TemporalQueries extends Object {
+  TemporalQuery chronology()
+  TemporalQuery localDate()
+  TemporalQuery localTime()
+  TemporalQuery offset()
+  TemporalQuery precision()
+  TemporalQuery zone()
+  TemporalQuery zoneId()
+}
+
+class ValueRange -> java.time.temporal.ValueRange extends Object {
+  int checkValidIntValue(long,TemporalField)
+  long checkValidValue(long,TemporalField)
+  long getLargestMinimum()
+  long getMaximum()
+  long getMinimum()
+  long getSmallestMaximum()
+  boolean isFixed()
+  boolean isIntValue()
+  boolean isValidIntValue(long)
+  boolean isValidValue(long)
+  ValueRange of(long,long)
+  ValueRange of(long,long,long)
+  ValueRange of(long,long,long,long)
+}
+
+class WeekFields -> java.time.temporal.WeekFields extends Object {
+  WeekFields ISO
+  WeekFields SUNDAY_START
+  TemporalUnit WEEK_BASED_YEARS
+  TemporalField dayOfWeek()
+  DayOfWeek getFirstDayOfWeek()
+  int getMinimalDaysInFirstWeek()
+  WeekFields of(DayOfWeek,int)
+  WeekFields of(Locale)
+  TemporalField weekBasedYear()
+  TemporalField weekOfMonth()
+  TemporalField weekOfWeekBasedYear()
+  TemporalField weekOfYear()
+}
+
+#### Enums
+
+class ChronoField -> java.time.temporal.ChronoField extends Enum,Comparable,TemporalField,Object {
+  ChronoField ALIGNED_DAY_OF_WEEK_IN_MONTH
+  ChronoField ALIGNED_DAY_OF_WEEK_IN_YEAR
+  ChronoField ALIGNED_WEEK_OF_MONTH
+  ChronoField ALIGNED_WEEK_OF_YEAR
+  ChronoField AMPM_OF_DAY
+  ChronoField CLOCK_HOUR_OF_AMPM
+  ChronoField CLOCK_HOUR_OF_DAY
+  ChronoField DAY_OF_MONTH
+  ChronoField DAY_OF_WEEK
+  ChronoField DAY_OF_YEAR
+  ChronoField EPOCH_DAY
+  ChronoField ERA
+  ChronoField HOUR_OF_AMPM
+  ChronoField HOUR_OF_DAY
+  ChronoField INSTANT_SECONDS
+  ChronoField MICRO_OF_DAY
+  ChronoField MICRO_OF_SECOND
+  ChronoField MILLI_OF_DAY
+  ChronoField MILLI_OF_SECOND
+  ChronoField MINUTE_OF_DAY
+  ChronoField MINUTE_OF_HOUR
+  ChronoField MONTH_OF_YEAR
+  ChronoField NANO_OF_DAY
+  ChronoField NANO_OF_SECOND
+  ChronoField OFFSET_SECONDS
+  ChronoField PROLEPTIC_MONTH
+  ChronoField SECOND_OF_DAY
+  ChronoField SECOND_OF_MINUTE
+  ChronoField YEAR
+  ChronoField YEAR_OF_ERA
+  int checkValidIntValue(long)
+  long checkValidValue(long)
+  ChronoField valueOf(String)
+  ChronoField[] values()
+}
+
+class ChronoUnit -> java.time.temporal.ChronoUnit extends Enum,Comparable,TemporalUnit,Object {
+  ChronoUnit CENTURIES
+  ChronoUnit DAYS
+  ChronoUnit DECADES
+  ChronoUnit ERAS
+  ChronoUnit FOREVER
+  ChronoUnit HALF_DAYS
+  ChronoUnit HOURS
+  ChronoUnit MICROS
+  ChronoUnit MILLENNIA
+  ChronoUnit MILLIS
+  ChronoUnit MINUTES
+  ChronoUnit MONTHS
+  ChronoUnit NANOS
+  ChronoUnit SECONDS
+  ChronoUnit WEEKS
+  ChronoUnit YEARS
+  ChronoUnit valueOf(String)
+  ChronoUnit[] values()
+}
+
+#### Exceptions
+
+class UnsupportedTemporalTypeException -> java.time.temporal.UnsupportedTemporalTypeException extends DateTimeException,RuntimeException,Exception,Object {
+  UnsupportedTemporalTypeException <init>(String)
+}

+ 643 - 0
modules/lang-painless/src/main/resources/org/elasticsearch/painless/java.time.txt

@@ -0,0 +1,643 @@
+#
+# Licensed to Elasticsearch under one or more contributor
+# license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright
+# ownership. Elasticsearch licenses this file to you 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.
+#
+
+#
+# Painless definition file. This defines the hierarchy of classes,
+# what methods and fields they have, etc.
+#
+
+#### Classes
+
+class Clock -> java.time.Clock extends Object {
+  Clock fixed(Instant,ZoneId)
+  ZoneId getZone()
+  Instant instant()
+  long millis()
+  Clock offset(Clock,Duration)
+  Clock system(ZoneId)
+  Clock systemDefaultZone()
+  Clock systemUTC()
+  Clock tick(Clock,Duration)
+  Clock tickMinutes(ZoneId)
+  Clock tickSeconds(ZoneId)
+  Clock withZone(ZoneId)
+}
+
+class Duration -> java.time.Duration extends Comparable,TemporalAmount,Object {
+  Duration ZERO
+  Duration abs()
+  Duration between(Temporal,Temporal)
+  Duration dividedBy(long)
+  Duration from(TemporalAmount)
+  int getNano()
+  long getSeconds()
+  boolean isNegative()
+  boolean isZero()
+  Duration minus(Duration)
+  Duration minus(long,TemporalUnit)
+  Duration minusDays(long)
+  Duration minusHours(long)
+  Duration minusMinutes(long)
+  Duration minusSeconds(long)
+  Duration minusMillis(long)
+  Duration minusNanos(long)
+  Duration multipliedBy(long)
+  Duration negated()
+  Duration of(long,TemporalUnit)
+  Duration ofDays(long)
+  Duration ofHours(long)
+  Duration ofMillis(long) 
+  Duration ofMinutes(long)
+  Duration ofNanos(long)
+  Duration ofSeconds(long)
+  Duration ofSeconds(long,long)
+  Duration parse(CharSequence)
+  Duration plus(Duration)
+  Duration plus(long,TemporalUnit)
+  Duration plusDays(long)
+  Duration plusHours(long)
+  Duration plusMinutes(long)
+  Duration plusSeconds(long)
+  Duration plusMillis(long)
+  Duration plusNanos(long)
+  long toDays()
+  long toHours()
+  long toMinutes()
+  long toMillis()
+  long toNanos()
+  Duration withSeconds(long)
+  Duration withNanos(int)
+}
+
+class Instant -> java.time.Instant extends Comparable,Temporal,TemporalAccessor,TemporalAdjuster,Object {
+  Instant EPOCH
+  Instant MAX
+  Instant MIN
+  OffsetDateTime atOffset(ZoneOffset)
+  ZonedDateTime atZone(ZoneId)
+  Instant from(TemporalAccessor)
+  long getEpochSecond()
+  int getNano()
+  boolean isAfter(Instant)
+  boolean isBefore(Instant)
+  Instant minus(TemporalAmount)
+  Instant minus(long,TemporalUnit)
+  Instant minusMillis(long)
+  Instant minusNanos(long)
+  Instant minusSeconds(long)
+  Instant now()
+  Instant now(Clock)
+  Instant ofEpochSecond(long)
+  Instant ofEpochSecond(long,long)
+  Instant ofEpochMilli(long)
+  Instant parse(CharSequence)
+  Instant plus(TemporalAmount)
+  Instant plus(long,TemporalUnit)
+  Instant plusMillis(long)
+  Instant plusNanos(long)
+  Instant plusSeconds(long)
+  long toEpochMilli()
+  Instant truncatedTo(TemporalUnit)
+  Instant with(TemporalAdjuster)
+  Instant with(TemporalField,long)
+}
+
+class LocalDate -> java.time.LocalDate extends Comparable,ChronoLocalDate,Temporal,TemporalAccessor,TemporalAdjuster,Object {
+  LocalDate MAX
+  LocalDate MIN
+  LocalDateTime atStartOfDay()
+  ZonedDateTime atStartOfDay(ZoneId)
+  LocalDateTime atTime(LocalTime)
+  LocalDateTime atTime(int,int)
+  LocalDateTime atTime(int,int,int)
+  LocalDateTime atTime(int,int,int,int)
+  LocalDate from(TemporalAccessor)
+  IsoChronology getChronology()
+  int getDayOfMonth()
+  DayOfWeek getDayOfWeek()
+  int getDayOfYear()
+  Month getMonth()
+  int getMonthValue()
+  int getYear()
+  LocalDate minus(TemporalAmount)
+  LocalDate minus(long,TemporalUnit)
+  LocalDate minusYears(long)
+  LocalDate minusMonths(long)
+  LocalDate minusWeeks(long)
+  LocalDate minusDays(long)
+  LocalDate now()
+  LocalDate now(ZoneId)
+  LocalDate of(int,int,int)
+  LocalDate ofYearDay(int,int)
+  LocalDate ofEpochDay(long)
+  LocalDate parse(CharSequence)
+  LocalDate parse(CharSequence,DateTimeFormatter)
+  LocalDate plus(TemporalAmount)
+  LocalDate plus(long,TemporalUnit)
+  LocalDate plusYears(long)
+  LocalDate plusMonths(long)
+  LocalDate plusWeeks(long)
+  LocalDate plusDays(long)
+  LocalDate with(TemporalAdjuster)
+  LocalDate with(TemporalField,long)
+  LocalDate withDayOfMonth(int)
+  LocalDate withDayOfYear(int)
+  LocalDate withMonth(int)
+  LocalDate withYear(int)
+}
+
+class LocalDateTime -> java.time.LocalDateTime extends Comparable,ChronoLocalDateTime,Temporal,TemporalAccessor,TemporalAdjuster,Object {
+  LocalDateTime MIN
+  LocalDateTime MAX
+  OffsetDateTime atOffset(ZoneOffset)
+  ZonedDateTime atZone(ZoneId)
+  LocalDateTime from(TemporalAccessor)
+  int getDayOfMonth()
+  DayOfWeek getDayOfWeek()
+  int getDayOfYear()
+  int getHour()
+  int getMinute()
+  Month getMonth()
+  int getMonthValue()
+  int getNano()
+  int getSecond()
+  int getYear()
+  LocalDateTime minus(TemporalAmount)
+  LocalDateTime minus(long,TemporalUnit)
+  LocalDateTime minusDays(long)
+  LocalDateTime minusHours(long)
+  LocalDateTime minusMinutes(long)
+  LocalDateTime minusMonths(long)
+  LocalDateTime minusNanos(long)
+  LocalDateTime minusSeconds(long)
+  LocalDateTime minusWeeks(long)
+  LocalDateTime minusYears(long)
+  LocalDateTime now()
+  LocalDateTime now(ZoneId)
+  LocalDateTime of(LocalDate,LocalTime)
+  LocalDateTime of(int,int,int,int,int)
+  LocalDateTime of(int,int,int,int,int,int)
+  LocalDateTime of(int,int,int,int,int,int,int)
+  LocalDateTime ofInstant(Instant,ZoneId)
+  LocalDateTime ofEpochSecond(long,int,ZoneOffset)
+  LocalDateTime parse(CharSequence)
+  LocalDateTime parse(CharSequence,DateTimeFormatter)
+  LocalDateTime plus(TemporalAmount)
+  LocalDateTime plus(long,TemporalUnit)
+  LocalDateTime plusDays(long)
+  LocalDateTime plusHours(long)
+  LocalDateTime plusMinutes(long)
+  LocalDateTime plusMonths(long)
+  LocalDateTime plusNanos(long)
+  LocalDateTime plusSeconds(long)
+  LocalDateTime plusWeeks(long)
+  LocalDateTime plusYears(long)
+  LocalDateTime truncatedTo(TemporalUnit)
+  LocalDateTime with(TemporalAdjuster)
+  LocalDateTime with(TemporalField,long)
+  LocalDateTime withDayOfMonth(int)
+  LocalDateTime withDayOfYear(int)
+  LocalDateTime withHour(int)
+  LocalDateTime withMinute(int)
+  LocalDateTime withMonth(int)
+  LocalDateTime withSecond(int)
+  LocalDateTime withYear(int)
+}
+
+class LocalTime -> java.time.LocalTime extends Comparable,Temporal,TemporalAccessor,TemporalAdjuster,Object {
+  LocalTime MAX
+  LocalTime MIDNIGHT
+  LocalTime MIN
+  LocalTime NOON
+  LocalDateTime atDate(LocalDate)
+  OffsetTime atOffset(ZoneOffset)
+  String format(DateTimeFormatter)
+  LocalTime from(TemporalAccessor)
+  int getHour()
+  int getMinute()
+  int getNano()
+  int getSecond()
+  boolean isAfter(LocalTime)
+  boolean isBefore(LocalTime)
+  LocalTime minus(TemporalAmount)
+  LocalTime minus(long,TemporalUnit)
+  LocalTime minusHours(long)
+  LocalTime minusMinutes(long)
+  LocalTime minusNanos(long)
+  LocalTime minusSeconds(long)
+  LocalTime now()
+  LocalTime now(ZoneId)
+  LocalTime of(int,int)
+  LocalTime of(int,int,int)
+  LocalTime of(int,int,int,int)
+  LocalTime ofNanoOfDay(long)
+  LocalTime ofSecondOfDay(long)
+  LocalTime parse(CharSequence)
+  LocalTime parse(CharSequence,DateTimeFormatter)
+  LocalTime plus(TemporalAmount)
+  LocalTime plus(long,TemporalUnit)
+  LocalTime plusHours(long)
+  LocalTime plusMinutes(long)
+  LocalTime plusNanos(long)
+  LocalTime plusSeconds(long)
+  long toNanoOfDay()
+  int toSecondOfDay()
+  LocalTime truncatedTo(TemporalUnit)
+  LocalTime with(TemporalAdjuster)
+  LocalTime with(TemporalField,long)
+  LocalTime withHour(int)
+  LocalTime withMinute(int)
+  LocalTime withNano(int)
+  LocalTime withSecond(int)
+}
+
+class MonthDay -> java.time.MonthDay extends Comparable,TemporalAccessor,TemporalAdjuster,Object {
+  LocalDate atYear(int)
+  String format(DateTimeFormatter)
+  MonthDay from(TemporalAccessor)
+  int getMonthValue()
+  Month getMonth()
+  int getDayOfMonth()
+  boolean isAfter(MonthDay)
+  boolean isBefore(MonthDay)
+  boolean isValidYear(int)
+  MonthDay now()
+  MonthDay now(ZoneId)
+  MonthDay of(int,int)
+  MonthDay parse(CharSequence)   
+  MonthDay parse(CharSequence,DateTimeFormatter)
+  MonthDay with(Month)
+  MonthDay withDayOfMonth(int)
+  MonthDay withMonth(int)
+}
+
+class OffsetDateTime -> java.time.OffsetDateTime extends Comparable,Temporal,TemporalAccessor,TemporalAdjuster,Object {
+  OffsetDateTime MAX
+  OffsetDateTime MIN
+  ZonedDateTime atZoneSameInstant(ZoneId)
+  ZonedDateTime atZoneSimilarLocal(ZoneId)
+  String format(DateTimeFormatter)
+  OffsetDateTime from(TemporalAccessor)
+  int getDayOfMonth()
+  DayOfWeek getDayOfWeek()
+  int getDayOfYear()
+  int getHour()
+  int getMinute()
+  Month getMonth()
+  int getMonthValue()
+  int getNano()
+  ZoneOffset getOffset()
+  int getSecond()
+  int getYear()
+  boolean isAfter(OffsetDateTime)
+  boolean isBefore(OffsetDateTime)
+  boolean isEqual(OffsetDateTime)
+  OffsetDateTime minus(TemporalAmount)
+  OffsetDateTime minus(long,TemporalUnit)
+  OffsetDateTime minusYears(long)
+  OffsetDateTime minusMonths(long)
+  OffsetDateTime minusWeeks(long)
+  OffsetDateTime minusDays(long)
+  OffsetDateTime minusHours(long)
+  OffsetDateTime minusMinutes(long)
+  OffsetDateTime minusSeconds(long)
+  OffsetDateTime minusNanos(long)
+  OffsetDateTime now()
+  OffsetDateTime now(ZoneId)
+  OffsetDateTime of(LocalDate,LocalTime,ZoneOffset)
+  OffsetDateTime of(LocalDateTime,ZoneOffset)
+  OffsetDateTime of(int,int,int,int,int,int,int,ZoneOffset)
+  OffsetDateTime ofInstant(Instant,ZoneId)
+  OffsetDateTime parse(CharSequence)
+  OffsetDateTime parse(CharSequence,DateTimeFormatter)
+  OffsetDateTime plus(TemporalAmount)
+  OffsetDateTime plus(long,TemporalUnit)
+  OffsetDateTime plusYears(long)
+  OffsetDateTime plusMonths(long)
+  OffsetDateTime plusWeeks(long)
+  OffsetDateTime plusDays(long)
+  OffsetDateTime plusHours(long)
+  OffsetDateTime plusMinutes(long)
+  OffsetDateTime plusSeconds(long)
+  OffsetDateTime plusNanos(long)
+  Comparator timeLineOrder()
+  long toEpochSecond()
+  Instant toInstant()
+  LocalDate toLocalDate()
+  LocalDateTime toLocalDateTime()
+  LocalTime toLocalTime()
+  OffsetTime toOffsetTime()
+  ZonedDateTime toZonedDateTime()
+  OffsetDateTime truncatedTo(TemporalUnit)
+  OffsetDateTime with(TemporalAdjuster)
+  OffsetDateTime with(TemporalField,long)
+  OffsetDateTime withDayOfMonth(int)
+  OffsetDateTime withDayOfYear(int)
+  OffsetDateTime withHour(int)
+  OffsetDateTime withMinute(int)
+  OffsetDateTime withMonth(int)
+  OffsetDateTime withNano(int)
+  OffsetDateTime withSecond(int)
+  OffsetDateTime withYear(int)
+  OffsetDateTime withOffsetSameLocal(ZoneOffset)
+  OffsetDateTime withOffsetSameInstant(ZoneOffset)
+}
+
+class OffsetTime -> java.time.OffsetTime extends Comparable,Temporal,TemporalAccessor,TemporalAdjuster,Object {
+  OffsetTime MAX
+  OffsetTime MIN
+  String format(DateTimeFormatter)
+  OffsetTime from(TemporalAccessor)
+  int getHour()
+  int getMinute()
+  ZoneOffset getOffset()
+  int getSecond()
+  int getNano()
+  boolean isAfter(OffsetTime)
+  boolean isBefore(OffsetTime)
+  boolean isEqual(OffsetTime)
+  OffsetTime now()
+  OffsetTime now(ZoneId)
+  OffsetTime of(LocalTime,ZoneOffset)
+  OffsetTime of(int,int,int,int,ZoneOffset)
+  OffsetTime ofInstant(Instant,ZoneId)
+  OffsetTime plus(TemporalAmount)
+  OffsetTime plus(long,TemporalUnit)
+  OffsetTime plusHours(long)
+  OffsetTime plusMinutes(long)
+  OffsetTime plusSeconds(long)
+  OffsetTime plusNanos(long)
+  OffsetTime minus(TemporalAmount)
+  OffsetTime minus(long,TemporalUnit)
+  OffsetTime minusHours(long)
+  OffsetTime minusMinutes(long)
+  OffsetTime minusSeconds(long)
+  OffsetTime minusNanos(long)
+  OffsetTime parse(CharSequence)
+  OffsetTime parse(CharSequence,DateTimeFormatter)
+  LocalTime toLocalTime()
+  OffsetTime truncatedTo(TemporalUnit)
+  OffsetTime with(TemporalAdjuster)
+  OffsetTime with(TemporalField,long)
+  OffsetTime withHour(int)
+  OffsetTime withMinute(int)
+  OffsetTime withNano(int)
+  OffsetTime withOffsetSameLocal(ZoneOffset)
+  OffsetTime withOffsetSameInstant(ZoneOffset)
+  OffsetTime withSecond(int)
+}
+
+class Period -> java.time.Period extends ChronoPeriod,TemporalAmount,Object {
+  Period ZERO
+  Period between(LocalDate,LocalDate)
+  Period from(TemporalAmount)
+  IsoChronology getChronology()
+  int getDays()
+  int getMonths()
+  int getYears()
+  Period of(int,int,int)
+  Period ofYears(int)
+  Period ofMonths(int)
+  Period ofWeeks(int)
+  Period ofDays(int)
+  Period parse(CharSequence)
+  Period plus(TemporalAmount)
+  Period plusYears(long)
+  Period plusMonths(long)
+  Period plusDays(long)
+  Period minus(TemporalAmount)
+  Period minusYears(long)
+  Period minusMonths(long)
+  Period minusDays(long)
+  Period multipliedBy(int)
+  Period negated()
+  Period normalized()
+  long toTotalMonths()
+  Period withDays(int)
+  Period withMonths(int)
+  Period withYears(int)
+}
+
+class Year -> java.time.Year extends Comparable,Temporal,TemporalAccessor,TemporalAdjuster,Object {
+  int MAX_VALUE
+  int MIN_VALUE
+  LocalDate atDay(int)
+  YearMonth atMonth(int)
+  LocalDate atMonthDay(MonthDay)
+  String format(DateTimeFormatter)
+  Year from(TemporalAccessor)
+  int getValue()
+  boolean isAfter(Year)
+  boolean isLeap()
+  boolean isLeap(long)
+  boolean isValidMonthDay(MonthDay)
+  int length()
+  Year minus(TemporalAmount)
+  Year minus(long,TemporalUnit)
+  Year minusYears(long)
+  Year now()
+  Year now(ZoneId)
+  Year of(int)
+  Year parse(CharSequence)
+  Year parse(CharSequence,DateTimeFormatter)
+  Year plus(TemporalAmount)
+  Year plus(long,TemporalUnit)
+  Year plusYears(long)
+  Year with(TemporalAdjuster)
+  Year with(TemporalField,long)
+}
+
+class YearMonth -> java.time.YearMonth extends Comparable,Temporal,TemporalAccessor,TemporalAdjuster,Object {
+  LocalDate atDay(int)
+  LocalDate atEndOfMonth()
+  String format(DateTimeFormatter)
+  YearMonth from(TemporalAccessor)
+  Month getMonth()
+  int getMonthValue()
+  int getYear()
+  boolean isAfter(YearMonth)
+  boolean isBefore(YearMonth)
+  boolean isLeapYear()
+  boolean isValidDay(int)
+  int lengthOfMonth()
+  int lengthOfYear()
+  YearMonth minus(TemporalAmount)
+  YearMonth minus(long,TemporalUnit)
+  YearMonth minusYears(long)
+  YearMonth minusMonths(long)
+  YearMonth now()
+  YearMonth now(ZoneId)
+  YearMonth of(int,int)
+  YearMonth parse(CharSequence)
+  YearMonth parse(CharSequence,DateTimeFormatter)
+  YearMonth plus(TemporalAmount)
+  YearMonth plus(long,TemporalUnit)
+  YearMonth plusYears(long)
+  YearMonth plusMonths(long)
+  YearMonth with(TemporalAdjuster)
+  YearMonth with(TemporalField,long)
+  YearMonth withYear(int)
+  YearMonth withMonth(int)
+}
+
+class ZonedDateTime -> java.time.ZonedDateTime extends Comparable,ChronoZonedDateTime,Temporal,TemporalAccessor,Object {
+  int getDayOfMonth()
+  DayOfWeek getDayOfWeek()
+  int getDayOfYear()
+  int getHour()
+  LocalDate toLocalDate()
+  LocalDateTime toLocalDateTime()
+  int getMinute()
+  Month getMonth()
+  int getMonthValue()
+  int getNano()
+  int getSecond()
+  int getYear()
+  ZonedDateTime from(TemporalAccessor)
+  ZonedDateTime minus(TemporalAmount)
+  ZonedDateTime minus(long,TemporalUnit)
+  ZonedDateTime minusYears(long)
+  ZonedDateTime minusMonths(long)
+  ZonedDateTime minusWeeks(long)
+  ZonedDateTime minusDays(long)
+  ZonedDateTime minusHours(long)
+  ZonedDateTime minusMinutes(long)
+  ZonedDateTime minusSeconds(long)
+  ZonedDateTime minusNanos(long)
+  ZonedDateTime now()
+  ZonedDateTime now(ZoneId)
+  ZonedDateTime of(LocalDate,LocalTime,ZoneId)
+  ZonedDateTime of(LocalDateTime,ZoneId)
+  ZonedDateTime of(int,int,int,int,int,int,int,ZoneId)
+  ZonedDateTime ofInstant(Instant,ZoneId)
+  ZonedDateTime ofInstant(LocalDateTime,ZoneOffset,ZoneId)
+  ZonedDateTime ofLocal(LocalDateTime,ZoneId,ZoneOffset)
+  ZonedDateTime ofStrict(LocalDateTime,ZoneOffset,ZoneId)
+  ZonedDateTime parse(CharSequence)
+  ZonedDateTime parse(CharSequence,DateTimeFormatter)
+  ZonedDateTime plus(TemporalAmount)
+  ZonedDateTime plus(long,TemporalUnit)
+  ZonedDateTime plusDays(long)
+  ZonedDateTime plusHours(long)
+  ZonedDateTime plusMinutes(long)
+  ZonedDateTime plusMonths(long)
+  ZonedDateTime plusNanos(long)
+  ZonedDateTime plusSeconds(long)
+  ZonedDateTime plusWeeks(long)
+  ZonedDateTime plusYears(long)
+  OffsetDateTime toOffsetDateTime()
+  ZonedDateTime truncatedTo(TemporalUnit)
+  ZonedDateTime with(TemporalAdjuster)
+  ZonedDateTime with(TemporalField,long)
+  ZonedDateTime withDayOfMonth(int)
+  ZonedDateTime withDayOfYear(int)
+  ZonedDateTime withEarlierOffsetAtOverlap()
+  ZonedDateTime withFixedOffsetZone()
+  ZonedDateTime withHour(int)
+  ZonedDateTime withLaterOffsetAtOverlap()
+  ZonedDateTime withMinute(int)
+  ZonedDateTime withMonth(int)
+  ZonedDateTime withNano(int)
+  ZonedDateTime withSecond(int)
+  ZonedDateTime withYear(int)
+  ZonedDateTime withZoneSameLocal(ZoneId)
+  ZonedDateTime withZoneSameInstant(ZoneId)
+}
+
+class ZoneId -> java.time.ZoneId extends Object {
+  Map SHORT_IDS
+  Set getAvailableZoneIds()
+  ZoneId of(String)
+  ZoneId of(String,Map)
+  ZoneId ofOffset(String,ZoneOffset)
+  ZoneId from(TemporalAccessor)
+  String getId()
+  String getDisplayName(TextStyle,Locale)
+  ZoneId normalized()
+  ZoneId systemDefault()
+  ZoneRules getRules()
+}
+
+class ZoneOffset -> java.time.ZoneOffset extends ZoneId,Object {
+  ZoneOffset MAX
+  ZoneOffset MIN
+  ZoneOffset UTC
+  ZoneOffset from(TemporalAccessor)
+  int getTotalSeconds()
+  ZoneOffset of(String)
+  ZoneOffset ofHours(int)
+  ZoneOffset ofHoursMinutes(int,int)
+  ZoneOffset ofHoursMinutesSeconds(int,int,int)
+  ZoneOffset ofTotalSeconds(int)
+}
+
+#### Enums
+
+class DayOfWeek -> java.time.DayOfWeek extends Enum,Comparable,TemporalAccessor,TemporalAdjuster,Object {
+  DayOfWeek FRIDAY
+  DayOfWeek MONDAY
+  DayOfWeek SATURDAY
+  DayOfWeek SUNDAY
+  DayOfWeek THURSDAY
+  DayOfWeek TUESDAY
+  DayOfWeek WEDNESDAY
+  DayOfWeek of(int)
+  DayOfWeek from(TemporalAccessor)
+  int getValue()
+  String getDisplayName(TextStyle,Locale)
+  DayOfWeek minus(long)
+  DayOfWeek plus(long)
+  DayOfWeek valueOf(String)
+  DayOfWeek[] values()
+}
+
+class Month -> java.time.Month extends Enum,Comparable,TemporalAccessor,TemporalAdjuster,Object {
+  Month APRIL
+  Month AUGUST
+  Month DECEMBER
+  Month FEBRUARY
+  Month JANUARY
+  Month JULY
+  Month JUNE
+  Month MARCH
+  Month MAY
+  Month NOVEMBER
+  Month OCTOBER
+  Month SEPTEMBER
+  Month from(TemporalAccessor)
+  int firstDayOfYear(boolean)
+  Month firstMonthOfQuarter()
+  int getValue()
+  String getDisplayName(TextStyle,Locale)
+  int length(boolean)
+  int maxLength()
+  int minLength()
+  Month minus(long)
+  Month of(int)
+  Month plus(long)
+  Month valueOf(String)
+  Month[] values()
+}
+
+#### Exceptions
+
+class DateTimeException -> java.time.DateTimeException extends RuntimeException,Exception,Object {
+  DateTimeException <init>(String)
+}
+

+ 93 - 0
modules/lang-painless/src/main/resources/org/elasticsearch/painless/java.time.zone.txt

@@ -0,0 +1,93 @@
+#
+# Licensed to Elasticsearch under one or more contributor
+# license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright
+# ownership. Elasticsearch licenses this file to you 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.
+#
+
+#
+# Painless definition file. This defines the hierarchy of classes,
+# what methods and fields they have, etc.
+#
+
+#### Classes
+
+class ZoneOffsetTransition -> java.time.zone.ZoneOffsetTransition extends Comparable,Object {
+  LocalDateTime getDateTimeAfter()
+  LocalDateTime getDateTimeBefore()
+  Duration getDuration()
+  Instant getInstant()
+  ZoneOffset getOffsetAfter()
+  ZoneOffset getOffsetBefore()
+  boolean isGap()
+  boolean isOverlap()
+  boolean isValidOffset(ZoneOffset)
+  ZoneOffsetTransition of(LocalDateTime,ZoneOffset,ZoneOffset)
+  long toEpochSecond()
+}
+
+class ZoneOffsetTransitionRule -> java.time.zone.ZoneOffsetTransitionRule extends Object {
+  ZoneOffsetTransition createTransition(int)
+  int getDayOfMonthIndicator()
+  DayOfWeek getDayOfWeek()
+  LocalTime getLocalTime()
+  Month getMonth()
+  ZoneOffset getOffsetAfter()
+  ZoneOffset getOffsetBefore()
+  ZoneOffset getStandardOffset()
+  ZoneOffsetTransitionRule.TimeDefinition getTimeDefinition()
+  boolean isMidnightEndOfDay()
+  ZoneOffsetTransitionRule of(Month,int,DayOfWeek,LocalTime,boolean,ZoneOffsetTransitionRule.TimeDefinition,ZoneOffset,ZoneOffset,ZoneOffset)
+}
+
+class ZoneRules -> java.time.zone.ZoneRules extends Object {
+  Duration getDaylightSavings(Instant)
+  ZoneOffset getOffset(Instant)
+  ZoneOffset getStandardOffset(Instant)
+  ZoneOffsetTransition getTransition(LocalDateTime)
+  List getTransitionRules()
+  List getTransitions()
+  List getValidOffsets(LocalDateTime)
+  boolean isDaylightSavings(Instant)
+  boolean isFixedOffset()
+  boolean isValidOffset(LocalDateTime,ZoneOffset)
+  ZoneOffsetTransition nextTransition(Instant)
+  ZoneRules of(ZoneOffset)
+  ZoneRules of(ZoneOffset,ZoneOffset,List,List,List)
+  ZoneOffsetTransition previousTransition(Instant)
+}
+
+class ZoneRulesProvider -> java.time.zone.ZoneRulesProvider extends Object {
+  Set getAvailableZoneIds()
+  ZoneRules getRules(String,boolean)
+  NavigableMap getVersions(String)
+}
+
+#### Enums
+
+class ZoneOffsetTransitionRule.TimeDefinition -> java.time.zone.ZoneOffsetTransitionRule$TimeDefinition extends Enum,Comparable,Object {
+  ZoneOffsetTransitionRule.TimeDefinition STANDARD
+  ZoneOffsetTransitionRule.TimeDefinition UTC
+  ZoneOffsetTransitionRule.TimeDefinition WALL
+  LocalDateTime createDateTime(LocalDateTime,ZoneOffset,ZoneOffset)
+  ZoneOffsetTransitionRule.TimeDefinition valueOf(String)
+  ZoneOffsetTransitionRule.TimeDefinition[] values()
+}
+
+#### Exceptions
+
+class ZoneRulesException -> java.time.zone.ZoneRulesException extends DateTimeException,RuntimeException,Exception,Object {
+  ZoneRulesException <init>(String)
+}

+ 4 - 0
modules/lang-painless/src/main/resources/org/elasticsearch/painless/java.util.txt

@@ -491,6 +491,7 @@ class Calendar -> java.util.Calendar extends Comparable,Object {
   void setTimeInMillis(long)
   void setTimeZone(TimeZone)
   void setWeekDate(int,int,int)
+  Instant toInstant()
 }
 
 class Calendar.Builder -> java.util.Calendar$Builder extends Object {
@@ -583,6 +584,7 @@ class Date -> java.util.Date extends Comparable,Object {
   boolean after(Date)
   boolean before(Date)
   def clone()
+  Date from(Instant)
   long getTime()
   void setTime(long)
 }
@@ -976,6 +978,8 @@ class TimeZone -> java.util.TimeZone extends Object {
   boolean hasSameRules(TimeZone)
   boolean inDaylightTime(Date)
   boolean observesDaylightTime()
+  void setRawOffset(int)
+  ZoneId toZoneId()
   boolean useDaylightTime()
 }