com.novell.sentinel.json
Interface JSONDateHandler

All Known Implementing Classes:
JSONDateHandlerJava

public interface JSONDateHandler

Interface to allow users of Sentinel bean objects to supply an implementation that can serialize and de-serialize date representations.

It would be simplest to use java.text.SimpleDateFormat, but that class is not available under GWT, one of the the primary targets for the beans.

Instances implementing this class must be thread-safe.


Field Summary
static String ISO_DATETIME_FORMAT
          The format (in SimpleDateFormat terms) to and from which dates are serialized.
 
Method Summary
 String format(Date date)
          Serialize a date to the format specified by ISO_DATETIME_FORMAT.
 Date parse(String dateString)
          Parse a string that should be serialized date the format specified by ISO_DATETIME_FORMAT.
 

Field Detail

ISO_DATETIME_FORMAT

static final String ISO_DATETIME_FORMAT
The format (in SimpleDateFormat terms) to and from which dates are serialized.

See Also:
Constant Field Values
Method Detail

parse

Date parse(String dateString)
           throws ParseException
Parse a string that should be serialized date the format specified by ISO_DATETIME_FORMAT.

Parameters:
dateString - The input.
Returns:
The Date object corresponding to the parsed string.
Throws:
ParseException - If the input is not in the correct format.
See Also:
ISO_DATETIME_FORMAT

format

String format(Date date)
Serialize a date to the format specified by ISO_DATETIME_FORMAT.

Parameters:
date - The input.
Returns:
The serialized data.