com.bankframe.util
Class DateConvertor

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

Deprecated. Use the com.bankframe.validation.DateConvertor class instead

public class DateConvertor
extends java.lang.Object

The DateConvertor class is used in bankframe to convert date objects to string objects and vice verse. The dates will be formatted in accordance with either a supplied formatting pattern or the pattern for the Locale. When processing date objects and strings using the static methods in this class the formatting pattern for the date can be supplied or it can be passed as a null value. If the formatting pattern is null, the formatting pattern is pulled from the BankframeDatePatterns.properties file. The value retrieved will be the formatting pattern for the previously set Locale. Setting the locale is not the responsibility of this class.


Constructor Summary
DateConvertor()
          Deprecated.  
 
Method Summary
static java.lang.String convertDateToString(java.lang.String formattingPattern, java.util.Date dateToConvert)
          Deprecated. Method to convert a date object to a string object If the formatting pattern is null, the date will be formatted based on the pattern supplied for the current Locale.
static java.util.Date convertStringToDate(java.lang.String formattingPattern, java.lang.String date)
          Deprecated. Method to convert a string object to a date object with no specified time If the formatting pattern is null, the date will be formatted based on the pattern supplied for the current Locale.
static java.util.Date convertStringToDate(java.lang.String formattingPattern, java.lang.String date, java.lang.String time)
          Deprecated. Method to convert a string object to a date object with a specified time.
static java.lang.String getCurrentTime(java.lang.String formattingPattern)
          Deprecated. This method will return a String representing the current time.
static java.lang.String getDateString(java.lang.String formattingPattern, java.util.Date date)
          Deprecated. This method will return a string representing the date from a date object in the form implied by the formattingPattern parameter.
static java.util.Locale getLocale()
          Deprecated. get method to retrieve the current locale.
static java.lang.String getTimeString(java.lang.String formattingPattern, java.util.Date date)
          Deprecated. This method will return a string representing the time from a date object in the form implied by the formattingPattern parameter
If the formattingPattern parameter is null the pattern for the Locale is used.
static java.lang.String getTodaysDate(java.lang.String formattingPattern)
          Deprecated. This method will return a String representing the today's date.
static java.lang.String getTodaysDateAndTime(java.lang.String formattingPattern)
          Deprecated. This method will return a String representing today's date and time.
static void setLocale(java.util.Locale locale)
          Deprecated. Set method to change the current locale.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateConvertor

public DateConvertor()
Deprecated. 
Method Detail

setLocale

public static void setLocale(java.util.Locale locale)
Deprecated. 
Set method to change the current locale.

Parameters:
locale - string representing the locale the date is to be formatted to.

getLocale

public static java.util.Locale getLocale()
                                  throws MissingLocaleException
Deprecated. 
get method to retrieve the current locale.

Returns:
currentLocale string representing the locale the date is to be formatted to.
Throws:
MissingLocaleException

convertStringToDate

public static java.util.Date convertStringToDate(java.lang.String formattingPattern,
                                                 java.lang.String date,
                                                 java.lang.String time)
                                          throws MissingLocaleException,
                                                 ValidationException
Deprecated. 
Method to convert a string object to a date object with a specified time. It does this by concatenating the two string parameters and passing the string to a java.text.SimpleDateFormat object. This will return a conventional Date object representing the time implied by the date and time string parameter strings passed in. If the formatting pattern is null, the date will be formatted based on the pattern supplied for the current Locale.

Parameters:
date - string representing a date e.g. "12/11/1999"
time - string representing a time in 24 hour clock
Returns:
dateObject
Throws:
com.banframe.util.MissingLocaleException
MissingLocaleException
ValidationException

convertStringToDate

public static java.util.Date convertStringToDate(java.lang.String formattingPattern,
                                                 java.lang.String date)
                                          throws MissingLocaleException,
                                                 ValidationException
Deprecated. 
Method to convert a string object to a date object with no specified time If the formatting pattern is null, the date will be formatted based on the pattern supplied for the current Locale.

Parameters:
date - string representing a date e.g. "12/11/1999"
Returns:
dateObject initialised to midnight on that day
Throws:
MissingLocaleException
ValidationException

convertDateToString

public static java.lang.String convertDateToString(java.lang.String formattingPattern,
                                                   java.util.Date dateToConvert)
                                            throws MissingLocaleException
Deprecated. 
Method to convert a date object to a string object If the formatting pattern is null, the date will be formatted based on the pattern supplied for the current Locale.

Parameters:
formattingPattern - String pattern to format date to.
dateToConvert - Date object tp process into a string
Throws:
MissingLocaleException

getDateString

public static java.lang.String getDateString(java.lang.String formattingPattern,
                                             java.util.Date date)
                                      throws MissingLocaleException
Deprecated. 
This method will return a string representing the date from a date object in the form implied by the formattingPattern parameter. If the formattingPattern parameter is null the pattern for the Locale is used.

Parameters:
formattingPattern -
date - java.util.date
Returns:
dateTimeArray[0] first element of the dateTimeArray which represents the date string we are looking for.
Throws:
MissingLocaleException

getTimeString

public static java.lang.String getTimeString(java.lang.String formattingPattern,
                                             java.util.Date date)
                                      throws MissingLocaleException
Deprecated. 
This method will return a string representing the time from a date object in the form implied by the formattingPattern parameter
If the formattingPattern parameter is null the pattern for the Locale is used.

Parameters:
formattingPattern -
date - java.util.date
Returns:
dateTimeArray[1] second element of the dateTimeArray which represents the time string we are looking for.
Throws:
MissingLocaleException

getCurrentTime

public static java.lang.String getCurrentTime(java.lang.String formattingPattern)
                                       throws MissingLocaleException
Deprecated. 
This method will return a String representing the current time.

Parameters:
formattingPattern - String describing the pattern to format the time. If this is passed as null the formatting pattern for the locale will be used.
Throws:
MissingLocaleException

getTodaysDate

public static java.lang.String getTodaysDate(java.lang.String formattingPattern)
                                      throws MissingLocaleException
Deprecated. 
This method will return a String representing the today's date.

Parameters:
formattingPattern - String describing the pattern to format the date. If this is passed as null the formatting pattern for the locale will be used.
Throws:
MissingLocaleException

getTodaysDateAndTime

public static java.lang.String getTodaysDateAndTime(java.lang.String formattingPattern)
                                             throws MissingLocaleException
Deprecated. 
This method will return a String representing today's date and time.

Parameters:
formattingPattern - String describing the pattern to format the date. If this is passed as null the formatting pattern for the locale will be used.
Throws:
MissingLocaleException


Copyright © 2005, 2007, Oracle. All rights reserved.