org.clazzes.util.datetime
Class ISO8601Format

java.lang.Object
  extended by java.text.Format
      extended by org.clazzes.util.datetime.ISO8601Format
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class ISO8601Format
extends java.text.Format

Format Calendar objects cf. ISO8601

Author:
wglas
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.text.Format
java.text.Format.Field
 
Field Summary
static int DATE_FORMAT
          Format Calendars using only date fields.
static int DATETIME_FORMAT
          Format Calendars using date and time fields including the timezone designator.
static int DATETIME_FORMAT_NO_TZ
          Format Calendars using date and time fields skipping the timezone designator.
static int MILLISECOND_FORMAT
          Format Calendars using date and time fields up to milliseconds including the timezone designator.
static int MILLISECOND_FORMAT_NO_TZ
          Format Calendars using date and time fields up to milliseconds skipping the timezone designator.
 
Constructor Summary
ISO8601Format(int format)
          Instantiate an ISO8601 formatter using the given format.
ISO8601Format(int format, java.util.TimeZone timeZone)
          Instantiate an ISO8601 formatter using the given format.
 
Method Summary
 java.lang.StringBuffer format(java.lang.Object o, java.lang.StringBuffer buf, java.text.FieldPosition pos)
           
 java.lang.Object parseObject(java.lang.String str, java.text.ParsePosition pos)
           
 
Methods inherited from class java.text.Format
clone, format, formatToCharacterIterator, parseObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATE_FORMAT

public static int DATE_FORMAT
Format Calendars using only date fields.


DATETIME_FORMAT

public static int DATETIME_FORMAT
Format Calendars using date and time fields including the timezone designator.


MILLISECOND_FORMAT

public static int MILLISECOND_FORMAT
Format Calendars using date and time fields up to milliseconds including the timezone designator.


DATETIME_FORMAT_NO_TZ

public static int DATETIME_FORMAT_NO_TZ
Format Calendars using date and time fields skipping the timezone designator.


MILLISECOND_FORMAT_NO_TZ

public static int MILLISECOND_FORMAT_NO_TZ
Format Calendars using date and time fields up to milliseconds skipping the timezone designator.

Constructor Detail

ISO8601Format

public ISO8601Format(int format)
Instantiate an ISO8601 formatter using the given format. The created instance uses UTC as the timezone for Calendar instances instantiated during parse operations.

Parameters:
format - DATE_FORMAT or DATETIME_FORMAT or MILLISECOND_FORMAT or DATETIME_FORMAT_NO_TZ or MILLISECOND_FORMAT_NO_TZ.

ISO8601Format

public ISO8601Format(int format,
                     java.util.TimeZone timeZone)
Instantiate an ISO8601 formatter using the given format.

Parameters:
format - DATE_FORMAT or DATETIME_FORMAT or MILLISECOND_FORMAT or DATETIME_FORMAT_NO_TZ or MILLISECOND_FORMAT_NO_TZ.
timeZone - The time zone used to instantiate Calendar during parse operations.
Method Detail

format

public java.lang.StringBuffer format(java.lang.Object o,
                                     java.lang.StringBuffer buf,
                                     java.text.FieldPosition pos)
Specified by:
format in class java.text.Format

parseObject

public java.lang.Object parseObject(java.lang.String str,
                                    java.text.ParsePosition pos)
Specified by:
parseObject in class java.text.Format


Copyright © 2009. All Rights Reserved.