Examples of ThreadSafeSimpleDateFormat


Examples of com.dotmarketing.util.ThreadSafeSimpleDateFormat

  public ESMappingAPIImpl() {
    if (mapper == null) {
      synchronized (this.getClass().getName()) {
        if (mapper == null) {
          mapper = new ObjectMapper();
          ThreadSafeSimpleDateFormat df = new ThreadSafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
          mapper.setDateFormat(df);
        }
      }
    }
  }
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.utils.ThreadSafeSimpleDateFormat

      // - YYYY    ... (default age-out: 3 years)
     
      String dateStr = m.group(2);
      Date indexDate = null;
      long periodInMs = -1;
      ThreadSafeSimpleDateFormat dateFormatter = new ThreadSafeSimpleDateFormat("yyyy.MM.dd");
      try {
        indexDate = dateFormatter.parse(dateStr);
        if (-1 == ageOutTime) { // (ie not overridden)
          ageOutTime = AGE_OUT_TIME_DAYS; // (default)
        }
        periodInMs = 3600L*24L*1000L; // (24h)
      }//TESTED
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.utils.ThreadSafeSimpleDateFormat

  protected static class DateSerializer implements JsonSerializer<Date>
  {
    @Override
    public JsonElement serialize(Date date, Type typeOfT, JsonSerializationContext context)
    {
      ThreadSafeSimpleDateFormat tsdf = new ThreadSafeSimpleDateFormat("MMM d, yyyy hh:mm:ss a 'UTC'");
      return new JsonPrimitive(tsdf.format(date));
    }
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.utils.ThreadSafeSimpleDateFormat

    @Override
    public JsonElement serialize(Date date, Type typeOfT, JsonSerializationContext context)
    {
      Date d = (Date)date;
      if (null == _format) {
        _format = new ThreadSafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
        _format.setCalendar(new GregorianCalendar(new SimpleTimeZone(0, "UTC")));
      }
      JsonObject jo = new JsonObject();
      jo.addProperty("$date", _format.format(d));
      return jo;
View Full Code Here

Examples of com.thoughtworks.xstream.core.util.ThreadSafeSimpleDateFormat

     */
    public DateConverter(
            final String defaultEraFormat, final String defaultFormat, final String[] acceptableFormats,
            final Locale locale, final TimeZone timeZone, final boolean lenient) {
        if (defaultEraFormat != null) {
            this.defaultEraFormat = new ThreadSafeSimpleDateFormat(defaultEraFormat, timeZone, locale, 4, 20, lenient);
        } else {
            this.defaultEraFormat = null;
        }
        this.defaultFormat = new ThreadSafeSimpleDateFormat(defaultFormat, timeZone, locale, 4, 20, lenient);
        this.acceptableFormats = acceptableFormats != null
            ? new ThreadSafeSimpleDateFormat[acceptableFormats.length]
            : new ThreadSafeSimpleDateFormat[0];
        for (int i = 0; i < this.acceptableFormats.length; i++) {
            this.acceptableFormats[i] = new ThreadSafeSimpleDateFormat(acceptableFormats[i], timeZone, locale, 1, 20,
                lenient);
        }
    }
View Full Code Here

Examples of com.thoughtworks.xstream.core.util.ThreadSafeSimpleDateFormat

     * @param lenient the lenient setting of {@link SimpleDateFormat#setLenient(boolean)}
     * @since 1.4
     */
    public DateConverter(
        String defaultFormat, String[] acceptableFormats, TimeZone timeZone, boolean lenient) {
        this.defaultFormat = new ThreadSafeSimpleDateFormat(
            defaultFormat, timeZone, 4, 20, lenient);
        this.acceptableFormats = acceptableFormats != null
            ? new ThreadSafeSimpleDateFormat[acceptableFormats.length]
            : new ThreadSafeSimpleDateFormat[0];
        for (int i = 0; i < this.acceptableFormats.length; i++ ) {
            this.acceptableFormats[i] = new ThreadSafeSimpleDateFormat(
                acceptableFormats[i], timeZone, 1, 20, lenient);
        }
    }
View Full Code Here

Examples of com.thoughtworks.xstream.core.util.ThreadSafeSimpleDateFormat

     * @param acceptableFormats fallback formats
     * @param lenient the lenient setting of {@link SimpleDateFormat#setLenient(boolean)}
     * @since 1.3
     */
    public DateConverter(String defaultFormat, String[] acceptableFormats, boolean lenient) {
        this.defaultFormat = new ThreadSafeSimpleDateFormat(defaultFormat, 4, 20, lenient);
        this.acceptableFormats = new ThreadSafeSimpleDateFormat[acceptableFormats.length];
        for (int i = 0; i < acceptableFormats.length; i++) {
            this.acceptableFormats[i] = new ThreadSafeSimpleDateFormat(acceptableFormats[i], 1, 20, lenient);
        }
    }
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.