|
Rakesh API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbiz.wedoit4u.ejb.session.SessionBeanAdapter
biz.wedoit4u.ejb.session.DateFormatterBean
public class DateFormatterBean
Common date transformations that are performed.
Copyright 2003, wedoit4u.biz
| Field Summary | |
|---|---|
private java.text.SimpleDateFormat |
dateTimeFormat
The formatter that will be used for ISO 8601 date-time
formats. |
static java.lang.String |
DATETIMEFORMAT
The format that will be used to specify date-time values in the ISO 8601 format. |
private java.text.SimpleDateFormat |
dayFormat
The formatter that will be used for ISO 8601 day
formats. |
static java.lang.String |
DAYFORMAT
The format that will be used to specify day values to encode/decode date objects. |
private java.text.SimpleDateFormat |
dayFormatWithTimeZone
The formatter that will be used for ISO 8601 day
formats. |
private java.text.SimpleDateFormat |
sqlTimestampFormat
The formatter that will be used for SQL Timestamp
formats. |
static java.lang.String |
SQLTIMESTAMPFORMAT
The format that will be used to specify date-time values to encode/decode date objects in SQL timestamp format. |
private java.text.SimpleDateFormat |
timeFormat
The formatter that will be used for ISO 8601 time
formats. |
static java.lang.String |
TIMEFORMAT
The format that will be used to specify time values to encode/decode date objects. |
| Fields inherited from class biz.wedoit4u.ejb.session.SessionBeanAdapter |
|---|
sessionContext |
| Constructor Summary | |
|---|---|
DateFormatterBean()
Default constructor. |
|
| Method Summary | |
|---|---|
java.lang.String |
getDateTime(java.util.Date date)
Formats the specified Date object in ISO 8601
date-time format (yyyy-MM-dd'T'HH-mm-ss'Z'). |
java.util.Date |
getDateTime(java.lang.String date)
Parses the specified String object in ISO 8601
date-time format (yyyy-MM-dd'T'HH-mm-ss'Z') into a
Java Date. |
java.lang.String |
getDay(java.util.Date date)
Formats the specified Date object in ISO 8601
day format (yyyy-MM-dd). |
java.util.Date |
getDay(java.lang.String date)
Parses the specified String in ISO 8601
day format (yyyy-MM-dd) into a Java Date. |
java.lang.String |
getSQLTimestamp(java.util.Date date)
Formats the specified Date object in SQL
timestamp format (yyyy-MM-dd HH-mm-ss). |
java.util.Date |
getSQLTimestamp(java.lang.String date)
Parses the specified String object in SQL
timestamp format (yyyy-MM-dd HH-mm-ss) into a
Java Date. |
java.lang.String |
getTime(java.util.Date date)
Formats the specified Date object in ISO 8601
time format (HH:mm:ss). |
java.util.Date |
getTime(java.lang.String date)
Parses the specified String object in ISO 8601
time format (HH:mm:ss) into a Java Date. |
| Methods inherited from class biz.wedoit4u.ejb.session.SessionBeanAdapter |
|---|
ejbActivate, ejbCreate, ejbPassivate, ejbRemove, setSessionContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DAYFORMAT
date objects.
public static final java.lang.String TIMEFORMAT
date objects.
public static final java.lang.String SQLTIMESTAMPFORMAT
date objects in SQL timestamp format.
public static final java.lang.String DATETIMEFORMAT
private java.text.SimpleDateFormat dayFormat
ISO 8601 day
formats. No time-zone is set for this formatter.
DAYFORMATprivate java.text.SimpleDateFormat dayFormatWithTimeZone
ISO 8601 day
formats.
DAYFORMATprivate java.text.SimpleDateFormat timeFormat
ISO 8601 time
formats. No time-zone is set for this formatter.
TIMEFORMATprivate java.text.SimpleDateFormat dateTimeFormat
ISO 8601 date-time
formats. No time-zone is set for this formatter.
DATETIMEFORMATprivate java.text.SimpleDateFormat sqlTimestampFormat
SQL Timestamp
formats. No time-zone is set for this formatter.
SQLTIMESTAMPFORMAT| Constructor Detail |
|---|
public DateFormatterBean()
| Method Detail |
|---|
public java.lang.String getDay(java.util.Date date)
Date object in ISO 8601
day format (yyyy-MM-dd). This is also the SQL
Date format.
date - - The input date that is to be formatted.
public java.util.Date getDay(java.lang.String date)
throws java.text.ParseException
String in ISO 8601
day format (yyyy-MM-dd) into a Java Date.
This is also the SQL Date format.
date - - The input date that is to be parsed.
java.text.ParseException - - If an exception is encountered while
attempting to parse the input String in yyyy-MM-dd format
into a Java Date.public java.lang.String getTime(java.util.Date date)
Date object in ISO 8601
time format (HH:mm:ss). This is also the SQL
Time format.
date - - The input date that is to be formatted.
public java.util.Date getTime(java.lang.String date)
throws java.text.ParseException
String object in ISO 8601
time format (HH:mm:ss) into a Java Date. This
is also the SQL Time format.
date - - The input date that is to be parsed.
java.text.ParseException - - If an exception is encountered while
attempting to parse the input String in HH-mm-ss format
into a Java Date.public java.lang.String getDateTime(java.util.Date date)
Date object in ISO 8601
date-time format (yyyy-MM-dd'T'HH-mm-ss'Z').
Note: This assumes that the input string is in UTC
as indicated by the 'Z'.
date - - The input date that is to be formatted.
public java.util.Date getDateTime(java.lang.String date)
throws java.text.ParseException
String object in ISO 8601
date-time format (yyyy-MM-dd'T'HH-mm-ss'Z') into a
Java Date.
Note: This assumes that the input string is in UTC
as indicated by the 'Z'.
date - - The input string that is to be formatted.
java.text.ParseExceptionpublic java.lang.String getSQLTimestamp(java.util.Date date)
Date object in SQL
timestamp format (yyyy-MM-dd HH-mm-ss).
date - - The input date that is to be formatted.
public java.util.Date getSQLTimestamp(java.lang.String date)
throws java.text.ParseException
String object in SQL
timestamp format (yyyy-MM-dd HH-mm-ss) into a
Java Date.
date - - The input string that is to be formatted.
java.text.ParseException
|
Rakesh API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||