com.bankframe.validation
Class DateConvertor

java.lang.Object
  extended bycom.bankframe.validation.DateConvertor

public class DateConvertor
extends java.lang.Object

The DateConvertor class is used to convert date objects to string objects and vice versa. The dates will be formatted in accordance with a supplied formatting pattern. When processing date objects and strings using the static methods in this class the formatting pattern for the date must be supplied. If the formatting pattern is null, a ValidationException is thrown


Constructor Summary
DateConvertor()
           
 
Method Summary
static java.util.Date getDate(java.lang.String pattern, java.lang.String date)
          Method to convert a date string to an object
static java.lang.String getString(java.lang.String pattern, java.util.Date dateOrTime)
          Method to convert a Date object to a string
static java.sql.Time getTime(java.lang.String pattern, java.lang.String time)
          Method to convert a time string to a Time object
static java.sql.Timestamp getTimestamp(java.lang.String pattern, java.lang.String timestamp)
          Method to convert a date object to a string object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateConvertor

public DateConvertor()
Method Detail

getDate

public static java.util.Date getDate(java.lang.String pattern,
                                     java.lang.String date)
                              throws ValidationException
Method to convert a date string to an object

Parameters:
pattern - String pattern of the date String's format
date - String String to process into an object
Returns:
Date returns a Date object
Throws:
ValidationException - if input data null or empty

getString

public static java.lang.String getString(java.lang.String pattern,
                                         java.util.Date dateOrTime)
                                  throws ValidationException
Method to convert a Date object to a string

Parameters:
pattern - String pattern to format dateOrTime to.
dateOrTime - Date object tp process into a string
Returns:
String returns a String representation of the date/time
Throws:
ValidationException - if input data null or empty

getTime

public static java.sql.Time getTime(java.lang.String pattern,
                                    java.lang.String time)
                             throws ValidationException
Method to convert a time string to a Time object

Parameters:
pattern - String pattern of the time String's format
time - String to process into a Time object
Returns:
Time returns a Time object
Throws:
ValidationException - if input data null or empty

getTimestamp

public static java.sql.Timestamp getTimestamp(java.lang.String pattern,
                                              java.lang.String timestamp)
                                       throws ValidationException
Method to convert a date object to a string object

Parameters:
pattern - String pattern of the timestamp String's format
timestamp - String to process into a Timestamp object
Returns:
Timestamp returns a Timestamp object
Throws:
ValidationException - if input data null or empty


Copyright © 2004 Siebel Systems, Inc. All rights reserved.