Examples of toZoneId()


Examples of java.util.TimeZone.toZoneId()

  @UsesJava8
  private static class ZoneIdResolver {

    public static Object resolveZoneId(HttpServletRequest request) {
      TimeZone timeZone = RequestContextUtils.getTimeZone(request);
      return (timeZone != null ? timeZone.toZoneId() : ZoneId.systemDefault());
    }
  }

}
View Full Code Here

Examples of java.util.TimeZone.toZoneId()

    else {
      LocaleContext localeContext = LocaleContextHolder.getLocaleContext();
      if (localeContext instanceof TimeZoneAwareLocaleContext) {
        TimeZone timeZone = ((TimeZoneAwareLocaleContext) localeContext).getTimeZone();
        if (timeZone != null) {
          formatter = formatter.withZone(timeZone.toZoneId());
        }
      }
    }
    return formatter;
  }
View Full Code Here

Examples of java.util.TimeZone.toZoneId()

    MethodParameter zoneIdParameter = new MethodParameter(method, 9);

    assertTrue("ZoneId not supported", resolver.supportsParameter(zoneIdParameter));

    Object result = resolver.resolveArgument(zoneIdParameter, null, webRequest, null);
    assertEquals("Invalid result", timeZone.toZoneId(), result);
  }

  @Test
  public void inputStream() throws Exception {
    MethodParameter inputStreamParameter = new MethodParameter(method, 5);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.