Smack

org.jivesoftware.smack.util
Enum DateFormatType

java.lang.Object
  extended by java.lang.Enum<DateFormatType>
      extended by org.jivesoftware.smack.util.DateFormatType
All Implemented Interfaces:
Serializable, Comparable<DateFormatType>

public enum DateFormatType
extends Enum<DateFormatType>

Defines the various date and time profiles used in XMPP along with their associated formats.

Author:
Robin Collier

Enum Constant Summary
XEP_0082_DATE_PROFILE
           
XEP_0082_DATETIME_MILLIS_PROFILE
           
XEP_0082_DATETIME_PROFILE
           
XEP_0082_TIME_MILLIS_PROFILE
           
XEP_0082_TIME_MILLIS_ZONE_PROFILE
           
XEP_0082_TIME_PROFILE
           
XEP_0082_TIME_ZONE_PROFILE
           
XEP_0091_DATETIME
           
 
Method Summary
 SimpleDateFormat createFormatter()
          Create a SimpleDateFormat object with the format defined by getFormatString().
 String getFormatString()
          Get the format string as defined in either XEP-0082 or XEP-0091.
static DateFormatType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static DateFormatType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

XEP_0082_DATE_PROFILE

public static final DateFormatType XEP_0082_DATE_PROFILE

XEP_0082_DATETIME_PROFILE

public static final DateFormatType XEP_0082_DATETIME_PROFILE

XEP_0082_DATETIME_MILLIS_PROFILE

public static final DateFormatType XEP_0082_DATETIME_MILLIS_PROFILE

XEP_0082_TIME_PROFILE

public static final DateFormatType XEP_0082_TIME_PROFILE

XEP_0082_TIME_ZONE_PROFILE

public static final DateFormatType XEP_0082_TIME_ZONE_PROFILE

XEP_0082_TIME_MILLIS_PROFILE

public static final DateFormatType XEP_0082_TIME_MILLIS_PROFILE

XEP_0082_TIME_MILLIS_ZONE_PROFILE

public static final DateFormatType XEP_0082_TIME_MILLIS_ZONE_PROFILE

XEP_0091_DATETIME

public static final DateFormatType XEP_0091_DATETIME
Method Detail

values

public static DateFormatType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (DateFormatType c : DateFormatType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static DateFormatType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getFormatString

public String getFormatString()
Get the format string as defined in either XEP-0082 or XEP-0091.

Returns:
The defined string format for the date.

createFormatter

public SimpleDateFormat createFormatter()
Create a SimpleDateFormat object with the format defined by getFormatString().

Returns:
A new date formatter.

Smack

Copyright © 2003-2007 Jive Software.