public class CachingDateFormat
extends java.text.SimpleDateFormat
The cached string-date mappings are stored in a WeakHashMap.
DateFormat.setLenient(boolean),
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static class |
CachingDateFormat.SimpleDateFormatAndResolution |
static class |
CachingDateFormat.StringAndResolution |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
FORMAT_CMIS_SQL
yyyy-MM-dd'T'HH:mm:ss
|
static java.lang.String |
FORMAT_DATE_GENERIC
yyyy-MM-dd
|
static java.lang.String |
FORMAT_FULL_GENERIC
yyyy-MM-dd'T'HH:mm:ss
|
static java.lang.String |
FORMAT_TIME_GENERIC
HH:mm:ss
|
static CachingDateFormat.StringAndResolution[] |
LENIENT_FORMATS |
AM_PM_FIELD, calendar, DATE_FIELD, DAY_OF_WEEK_FIELD, DAY_OF_WEEK_IN_MONTH_FIELD, DAY_OF_YEAR_FIELD, DEFAULT, ERA_FIELD, FULL, HOUR_OF_DAY0_FIELD, HOUR_OF_DAY1_FIELD, HOUR0_FIELD, HOUR1_FIELD, LONG, MEDIUM, MILLISECOND_FIELD, MINUTE_FIELD, MONTH_FIELD, numberFormat, SECOND_FIELD, SHORT, TIMEZONE_FIELD, WEEK_OF_MONTH_FIELD, WEEK_OF_YEAR_FIELD, YEAR_FIELD| Modifier and Type | Method and Description |
|---|---|
static java.text.SimpleDateFormat |
getCmisSqlDatetimeFormat() |
static java.text.SimpleDateFormat |
getDateFormat() |
static java.text.SimpleDateFormat |
getDateFormat(int length,
java.util.Locale locale,
boolean lenient) |
static java.text.SimpleDateFormat |
getDateFormat(java.lang.String pattern,
boolean lenient) |
static java.text.SimpleDateFormat |
getDateOnlyFormat() |
static java.text.SimpleDateFormat |
getDateTimeFormat(int dateLength,
int timeLength,
java.util.Locale locale,
boolean lenient) |
static CachingDateFormat.SimpleDateFormatAndResolution[] |
getLenientFormatters() |
static java.text.SimpleDateFormat |
getTimeOnlyFormat() |
static Pair |
lenientParse(java.lang.String text,
int minimumResolution) |
java.util.Date |
parse(java.lang.String text,
java.text.ParsePosition pos)
Parses and caches date strings.
|
java.lang.String |
toString() |
applyLocalizedPattern, applyPattern, clone, equals, format, formatToCharacterIterator, get2DigitYearStart, getDateFormatSymbols, hashCode, set2DigitYearStart, setDateFormatSymbols, toLocalizedPattern, toPatternformat, format, getAvailableLocales, getCalendar, getDateInstance, getDateInstance, getDateInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getInstance, getNumberFormat, getTimeInstance, getTimeInstance, getTimeInstance, getTimeZone, isLenient, parse, parseObject, setCalendar, setLenient, setNumberFormat, setTimeZonepublic static final java.lang.String FORMAT_FULL_GENERIC
yyyy-MM-dd'T'HH:mm:ss
public static final java.lang.String FORMAT_CMIS_SQL
yyyy-MM-dd'T'HH:mm:ss
public static final CachingDateFormat.StringAndResolution[] LENIENT_FORMATS
public static final java.lang.String FORMAT_DATE_GENERIC
yyyy-MM-dd
public static final java.lang.String FORMAT_TIME_GENERIC
HH:mm:ss
public java.lang.String toString()
toString in class java.lang.Objectpublic static java.text.SimpleDateFormat getDateFormat(int length,
java.util.Locale locale,
boolean lenient)
length - the type of date format, e.g. DateFormat.LONGlocale - the Locale that will be used to determine the
date patternCachingDateFormat.getDateFormat(String, boolean),
DateFormat.SHORT,
DateFormat.MEDIUM,
DateFormat.LONG,
DateFormat.FULLpublic static java.text.SimpleDateFormat getDateTimeFormat(int dateLength,
int timeLength,
java.util.Locale locale,
boolean lenient)
dateLength - the type of date format, e.g. DateFormat.LONGtimeLength - the type of time format, e.g. DateFormat.LONGlocale - the Locale that will be used to determine the
date patternCachingDateFormat.getDateFormat(String, boolean),
DateFormat.SHORT,
DateFormat.MEDIUM,
DateFormat.LONG,
DateFormat.FULLpublic static java.text.SimpleDateFormat getDateFormat(java.lang.String pattern,
boolean lenient)
pattern - the conversion pattern to uselenient - true to allow the parser to extract the date in conceivable
mannerpublic static java.text.SimpleDateFormat getDateFormat()
CachingDateFormat.FORMAT_FULL_GENERICpublic static java.text.SimpleDateFormat getCmisSqlDatetimeFormat()
public static java.text.SimpleDateFormat getDateOnlyFormat()
CachingDateFormat.FORMAT_DATE_GENERICpublic static java.text.SimpleDateFormat getTimeOnlyFormat()
CachingDateFormat.FORMAT_TIME_GENERICpublic java.util.Date parse(java.lang.String text,
java.text.ParsePosition pos)
parse in class java.text.SimpleDateFormatDateFormat.parse(java.lang.String,
java.text.ParsePosition)public static Pair lenientParse(java.lang.String text, int minimumResolution) throws java.text.ParseException
java.text.ParseExceptionpublic static CachingDateFormat.SimpleDateFormatAndResolution[] getLenientFormatters()
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.