Package org.codehaus.jackson.map.util
Class StdDateFormat
java.lang.Object
java.text.Format
java.text.DateFormat
org.codehaus.jackson.map.util.StdDateFormat
- All Implemented Interfaces:
Serializable
,Cloneable
Default
DateFormat
implementation used by standard Date
serializers and deserializers. For serialization defaults to using
an ISO-8601 compliant format (format String "yyyy-MM-dd'T'HH:mm:ss.SSSZ")
and for deserialization, both ISO-8601 and RFC-1123.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.text.DateFormat
DateFormat.Field
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DateFormat
protected DateFormat
protected DateFormat
protected DateFormat
protected static final String[]
For error messages we'll also need a list of all formats.protected static final DateFormat
protected static final DateFormat
protected static final DateFormat
protected static final DateFormat
protected static final String
Defines a commonly used date format that conforms to ISO-8601 date formatting standard, when it includes basic undecorated timezone definitionprotected static final String
Same as 'regular' 8601, but handles 'Z' as an alias for "+0000" (or "GMT")protected static final String
ISO-8601 with just the Date part, no timeprotected static final String
This constant defines the date format specified by RFC 1123.static final StdDateFormat
A singleton instance can be used for cloning purposes.Fields inherited from class java.text.DateFormat
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
format
(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) static DateFormat
Method for getting the globally shared DateFormat instance that uses GMT timezone and can handle simple ISO-8601 compliant date format.static DateFormat
Method for getting the globally shared DateFormat instance that uses GMT timezone and can handle RFC-1123 compliant date format.static DateFormat
Method for getting a non-shared DateFormat instance that uses specified timezone and can handle simple ISO-8601 compliant date format.static DateFormat
Method for getting a non-shared DateFormat instance that uses specific timezone and can handle RFC-1123 compliant date format.protected boolean
looksLikeISO8601
(String dateStr) Overridable helper method used to figure out which of supported formats is the likeliest match.parse
(String dateStr, ParsePosition pos) protected Date
parseAsISO8601
(String dateStr, ParsePosition pos) protected Date
parseAsRFC1123
(String dateStr, ParsePosition pos) Methods inherited from class java.text.DateFormat
equals, format, format, getAvailableLocales, getCalendar, getDateInstance, getDateInstance, getDateInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getInstance, getNumberFormat, getTimeInstance, getTimeInstance, getTimeInstance, getTimeZone, hashCode, isLenient, parseObject, setCalendar, setLenient, setNumberFormat, setTimeZone
Methods inherited from class java.text.Format
format, formatToCharacterIterator, parseObject
-
Field Details
-
DATE_FORMAT_STR_ISO8601
Defines a commonly used date format that conforms to ISO-8601 date formatting standard, when it includes basic undecorated timezone definition- See Also:
-
DATE_FORMAT_STR_ISO8601_Z
Same as 'regular' 8601, but handles 'Z' as an alias for "+0000" (or "GMT")- See Also:
-
DATE_FORMAT_STR_PLAIN
ISO-8601 with just the Date part, no time- Since:
- 1.3.1
- See Also:
-
DATE_FORMAT_STR_RFC1123
This constant defines the date format specified by RFC 1123.- See Also:
-
ALL_FORMATS
For error messages we'll also need a list of all formats. -
DATE_FORMAT_RFC1123
-
DATE_FORMAT_ISO8601
-
DATE_FORMAT_ISO8601_Z
-
DATE_FORMAT_PLAIN
-
instance
A singleton instance can be used for cloning purposes. -
_formatRFC1123
-
_formatISO8601
-
_formatISO8601_z
-
_formatPlain
-
-
Constructor Details
-
StdDateFormat
public StdDateFormat()
-
-
Method Details
-
clone
- Overrides:
clone
in classDateFormat
-
getBlueprintISO8601Format
Method for getting the globally shared DateFormat instance that uses GMT timezone and can handle simple ISO-8601 compliant date format. -
getISO8601Format
Method for getting a non-shared DateFormat instance that uses specified timezone and can handle simple ISO-8601 compliant date format. -
getBlueprintRFC1123Format
Method for getting the globally shared DateFormat instance that uses GMT timezone and can handle RFC-1123 compliant date format. -
getRFC1123Format
Method for getting a non-shared DateFormat instance that uses specific timezone and can handle RFC-1123 compliant date format. -
parse
- Overrides:
parse
in classDateFormat
- Throws:
ParseException
-
parse
- Specified by:
parse
in classDateFormat
-
format
- Specified by:
format
in classDateFormat
-
looksLikeISO8601
Overridable helper method used to figure out which of supported formats is the likeliest match. -
parseAsISO8601
-
parseAsRFC1123
-