net.sf.seaf.util.convert.simple
Class ConverterToDatetime

java.lang.Object
  extended by net.sf.seaf.util.convert.simple.ConverterToDatetime

public class ConverterToDatetime
extends Object

Converter of any Object to a date-time represented by Calendar.


Field Summary
static String FORMAT_ISO
           
 
Constructor Summary
ConverterToDatetime()
           
 
Method Summary
static Calendar convert(Object o)
          Converts an Object to Calendar date-time value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORMAT_ISO

public static final String FORMAT_ISO
See Also:
Constant Field Values
Constructor Detail

ConverterToDatetime

public ConverterToDatetime()
Method Detail

convert

public static Calendar convert(Object o)
                        throws IllegalArgumentException
Converts an Object to Calendar date-time value.

Keeps null as null. Converts java.util.Date. Keeps Calendar. Otherwise converts via String expecting ISO date-time format (YYYY-MM-DD'T'HH:MM:SS).

Parameters:
o - Object to be converted
Returns:
Calendar
Throws:
IllegalArgumentException - Thrown when the argument is not a valid Datetime


Copyright © 2008-2012 SEAF. All Rights Reserved.