org.eclipse.datatools.connectivity.oda.flatfile.util
Class DateUtil

java.lang.Object
  extended by org.eclipse.datatools.connectivity.oda.flatfile.util.DateUtil

public final class DateUtil
extends java.lang.Object

A utility class. The convert method converts the source object into an Date object given specified type. If no reasonable conversion can be made, throw a OdaException.


Constructor Summary
DateUtil()
           
 
Method Summary
static java.util.Date toDate(java.lang.Object source)
          Number -> Date new Date((long)Number) String -> Date toDate(String)
static java.util.Date toDate(java.lang.String source, java.util.Locale locale)
          A temp solution to the adoption of ICU4J to BIRT.
static java.util.Date toDate(java.lang.String source, com.ibm.icu.util.ULocale locale)
          convert String with the specified locale to java.util.Date
static java.sql.Date toSqlDate(java.lang.Object source)
          Date -> Time String -> Time
static java.sql.Time toSqlTime(java.lang.Object source)
          Date -> Time String -> Time
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateUtil

public DateUtil()
Method Detail

toDate

public static java.util.Date toDate(java.lang.Object source)
                             throws OdaException
Number -> Date new Date((long)Number) String -> Date toDate(String)

Parameters:
source -
Returns:
Throws:
OdaException

toSqlTime

public static java.sql.Time toSqlTime(java.lang.Object source)
                               throws OdaException
Date -> Time String -> Time

Parameters:
source -
Returns:
Throws:
OdaException

toSqlDate

public static java.sql.Date toSqlDate(java.lang.Object source)
                               throws OdaException
Date -> Time String -> Time

Parameters:
source -
Returns:
Throws:
OdaException

toDate

public static java.util.Date toDate(java.lang.String source,
                                    java.util.Locale locale)
                             throws OdaException
A temp solution to the adoption of ICU4J to BIRT. Simply delegate toDate( String, Locale) method.

Parameters:
source - the String to be convert
locate - the locate of the string
Returns:
result Date
Throws:
OdaException

toDate

public static java.util.Date toDate(java.lang.String source,
                                    com.ibm.icu.util.ULocale locale)
                             throws OdaException
convert String with the specified locale to java.util.Date

Parameters:
source - the String to be convert
locate - the locate of the string
Returns:
result Date
Throws:
OdaException