Home | History | Annotate | Download | only in cookie

Lines Matching refs:SimpleDateFormat

36 import java.text.SimpleDateFormat;
157 SimpleDateFormat dateParser = DateFormatHolder.formatFor(dateFormat);
185 * must conform to that used by the {@link SimpleDateFormat simple date
194 * @see SimpleDateFormat
200 SimpleDateFormat formatter = DateFormatHolder.formatFor(pattern);
209 * A factory for {@link SimpleDateFormat}s. The instances are stored in a
210 * threadlocal way because SimpleDateFormat is not threadsafe as noted in
211 * {@link SimpleDateFormat its javadoc}.
217 private static final ThreadLocal<SoftReference<Map<String, SimpleDateFormat>>>
218 THREADLOCAL_FORMATS = new ThreadLocal<SoftReference<Map<String, SimpleDateFormat>>>() {
221 protected SoftReference<Map<String, SimpleDateFormat>> initialValue() {
222 return new SoftReference<Map<String, SimpleDateFormat>>(
223 new HashMap<String, SimpleDateFormat>());
229 * creates a {@link SimpleDateFormat} for the requested format string.
233 * {@link SimpleDateFormat}. The format is not checked against
237 * to {@link SimpleDateFormat#applyPattern(String) apply} to a
240 public static SimpleDateFormat formatFor(String pattern) {
241 SoftReference<Map<String, SimpleDateFormat>> ref = THREADLOCAL_FORMATS.get();
242 Map<String, SimpleDateFormat> formats = ref.get();
244 formats = new HashMap<String, SimpleDateFormat>();
246 new SoftReference<Map<String, SimpleDateFormat>>(formats));
249 SimpleDateFormat format = formats.get(pattern);
251 format = new SimpleDateFormat(pattern, Locale.US);