|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bankframe.validation.DateConvertor
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 |
public DateConvertor()
Method Detail |
public static java.util.Date getDate(java.lang.String pattern, java.lang.String date) throws ValidationException
pattern
- String pattern of the date String's formatdate
- String String to process into an object
ValidationException
- if input data null or emptypublic static java.lang.String getString(java.lang.String pattern, java.util.Date dateOrTime) throws ValidationException
pattern
- String pattern to format dateOrTime to.dateOrTime
- Date object tp process into a string
ValidationException
- if input data null or emptypublic static java.sql.Time getTime(java.lang.String pattern, java.lang.String time) throws ValidationException
pattern
- String pattern of the time String's formattime
- String to process into a Time object
ValidationException
- if input data null or emptypublic static java.sql.Timestamp getTimestamp(java.lang.String pattern, java.lang.String timestamp) throws ValidationException
pattern
- String pattern of the timestamp String's formattimestamp
- String to process into a Timestamp object
ValidationException
- if input data null or empty
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |