com.smartgwt.client.types
Enum JSONDateFormat

java.lang.Object
  extended by java.lang.Enum<JSONDateFormat>
      extended by com.smartgwt.client.types.JSONDateFormat
All Implemented Interfaces:
ValueEnum, Serializable, Comparable<JSONDateFormat>

public enum JSONDateFormat
extends Enum<JSONDateFormat>
implements ValueEnum

Format for encoding dates in JSON. Note you can override JSONEncoder.encodeDate(java.util.Date) for a custom format.


Enum Constant Summary
DATE_CONSTRUCTOR
          dates are encoded as raw JavaScript code for creating a Date object, that is:

new Date(1238792738633)

This is not strictly valid JSON, but if eval()d, will result in an identical date object, regardless of timezone.
XML_SCHEMA
          dates are is encoded as a String in XML Schema date format in UTC, for example, "2005-08-01T21:35:48.350"
 
Method Summary
 String getValue()
           
static JSONDateFormat valueOf(String name)
          Returns the enum constant of this type with the specified name.
static JSONDateFormat[] 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

XML_SCHEMA

public static final JSONDateFormat XML_SCHEMA
dates are is encoded as a String in XML Schema date format in UTC, for example, "2005-08-01T21:35:48.350"


DATE_CONSTRUCTOR

public static final JSONDateFormat DATE_CONSTRUCTOR
dates are encoded as raw JavaScript code for creating a Date object, that is:

new Date(1238792738633)

This is not strictly valid JSON, but if eval()d, will result in an identical date object, regardless of timezone.

Method Detail

values

public static JSONDateFormat[] 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 (JSONDateFormat c : JSONDateFormat.values())
    System.out.println(c);

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

valueOf

public static JSONDateFormat 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

getValue

public String getValue()
Specified by:
getValue in interface ValueEnum