com.skaringa.util
Class ISO8601DateFormat

java.lang.Object
  extended by java.text.Format
      extended by java.text.DateFormat
          extended by com.skaringa.util.ISO8601DateTimeFormat
              extended by com.skaringa.util.ISO8601DateFormat
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class ISO8601DateFormat
extends ISO8601DateTimeFormat

Format and parse an ISO 8601 DateFormat used in XML documents. The lexical representation for date is the reduced (right truncated) lexical representation for dateTime: CCYY-MM-DD. No left truncation is allowed. An optional following time zone qualifier is allowed as for dateTime.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.text.DateFormat
java.text.DateFormat.Field
 
Field Summary
 
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
ISO8601DateFormat()
          Construct a new ISO8601DateFormat using the default time zone.
ISO8601DateFormat(java.util.TimeZone tz)
          Construct a new ISO8601DateFormat using a specific time zone.
 
Method Summary
 java.lang.StringBuffer format(java.util.Date date, java.lang.StringBuffer sbuf, java.text.FieldPosition fieldPosition)
           
 java.util.Date parse(java.lang.String text, java.text.ParsePosition pos)
           
 
Methods inherited from class com.skaringa.util.ISO8601DateTimeFormat
appendInt, parseTZ, writeCCYYMM, writehhmmss, writeTZ
 
Methods inherited from class java.text.DateFormat
clone, equals, format, format, getAvailableLocales, getCalendar, getDateInstance, getDateInstance, getDateInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getInstance, getNumberFormat, getTimeInstance, getTimeInstance, getTimeInstance, getTimeZone, hashCode, isLenient, parse, parseObject, setCalendar, setLenient, setNumberFormat, setTimeZone
 
Methods inherited from class java.text.Format
format, formatToCharacterIterator, parseObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ISO8601DateFormat

public ISO8601DateFormat()
Construct a new ISO8601DateFormat using the default time zone.


ISO8601DateFormat

public ISO8601DateFormat(java.util.TimeZone tz)
Construct a new ISO8601DateFormat using a specific time zone.

Parameters:
tz - The time zone used to format and parse the date.
Method Detail

parse

public java.util.Date parse(java.lang.String text,
                            java.text.ParsePosition pos)
Overrides:
parse in class ISO8601DateTimeFormat
See Also:
DateFormat.parse(String, ParsePosition)

format

public java.lang.StringBuffer format(java.util.Date date,
                                     java.lang.StringBuffer sbuf,
                                     java.text.FieldPosition fieldPosition)
Overrides:
format in class ISO8601DateTimeFormat
See Also:
DateFormat.format(Date, StringBuffer, FieldPosition)