Package org.apache.http.client.utils
Class DateUtils.DateFormatHolder
java.lang.Object
org.apache.http.client.utils.DateUtils.DateFormatHolder
- Enclosing class:
- DateUtils
A factory for
SimpleDateFormat
s. The instances are stored in a
threadlocal way because SimpleDateFormat is not threadsafe as noted in
its javadoc
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ThreadLocal<SoftReference<Map<String,
SimpleDateFormat>>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
static SimpleDateFormat
creates aSimpleDateFormat
for the requested format string.
-
Field Details
-
THREADLOCAL_FORMATS
-
-
Constructor Details
-
DateFormatHolder
DateFormatHolder()
-
-
Method Details
-
formatFor
creates aSimpleDateFormat
for the requested format string.- Parameters:
pattern
- a non-null
format String according toSimpleDateFormat
. The format is not checked againstnull
since all paths go throughDateUtils
.- Returns:
- the requested format. This simple dateformat should not be used
to
apply
to a different pattern.
-
clearThreadLocal
public static void clearThreadLocal()
-