|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.kuali.rice.core.impl.datetime.DateTimeServiceImpl
public class DateTimeServiceImpl
This class is the service implementation for a DateTime structure. This is the default, Kuali delivered implementation.
| Field Summary | |
|---|---|
protected String |
dateToStringFormatForFileName
|
protected String |
dateToStringFormatForUserInterface
|
protected String[] |
stringToDateFormats
|
protected String[] |
stringToTimestampFormats
|
protected String |
timestampToStringFormatForFileName
|
protected String |
timestampToStringFormatForUserInterface
|
| Constructor Summary | |
|---|---|
DateTimeServiceImpl()
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
This overridden method ... |
Date |
convertToDate(String dateString)
Formats strings into dates using the format string in the KR-NS/All/STRING_TO_DATE_FORMATS parameter |
Date |
convertToDateTime(String dateTimeString)
Translates the specified string into a date with a time component, formatted according to "stringDateTimeFormat" that the service is configured with |
Date |
convertToSqlDate(String dateString)
Converts the given String into a java.sql.Date instance |
Date |
convertToSqlDate(Timestamp timestamp)
Converts a Timestamp into a sql Date. |
Timestamp |
convertToSqlTimestamp(String timeString)
Converts the given String into a java.sql.Timestamp instance according to the "stringDateTimeFormat" that the service is configured with |
int |
dateDiff(Date startDate,
Date endDate,
boolean inclusive)
Returns the number of days between two days - start and end date of some arbitrary period. |
Calendar |
getCalendar(Date date)
Returns a Calendar initialized to the given Date |
Calendar |
getCurrentCalendar()
Returns a Calendar initialized with the current Date |
Date |
getCurrentDate()
Returns the current date/time as a java.util.Date |
Date |
getCurrentSqlDate()
Returns the current date/time as a java.sql.Date |
Date |
getCurrentSqlDateMidnight()
Returns the current date as a java.sql.Date rounded back to midnight. |
Timestamp |
getCurrentTimestamp()
Returns the current date/time as a java.sql.Timestamp |
protected Date |
parse(String dateString,
String pattern)
|
protected Date |
parseAgainstFormatArray(String dateString,
String[] formats)
|
String |
toDateString(Date date)
Translates the specified date into a string without a time component, formatted according to "stringDateFormat" that the service is configured with |
String |
toDateStringForFilename(Date date)
Returns a String representing a date that is suitable for file names, and is preferably chronologically sortable |
String |
toDateTimeString(Date date)
Translates the specified date into a string with a time component, formatted according to the "stringDateTimeFormat" that the service is configured with |
String |
toDateTimeStringForFilename(Date date)
Returns a String representing a date/time that is suitable for file names, and is preferably chronologically sortable |
String |
toString(Date date,
String pattern)
Translates the specified date into a string without a time component, formatted according to the specified pattern |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String[] stringToDateFormats
protected String[] stringToTimestampFormats
protected String dateToStringFormatForUserInterface
protected String timestampToStringFormatForUserInterface
protected String dateToStringFormatForFileName
protected String timestampToStringFormatForFileName
| Constructor Detail |
|---|
public DateTimeServiceImpl()
| Method Detail |
|---|
public String toDateString(Date date)
DateTimeService
toDateString in interface DateTimeServiceDateTimeService.toDateString(java.util.Date)public String toDateTimeString(Date date)
DateTimeService
toDateTimeString in interface DateTimeServiceDateTimeService.toDateTimeString(java.util.Date)
public String toString(Date date,
String pattern)
DateTimeService
toString in interface DateTimeServiceDateTimeService.toString(java.util.Date,
java.lang.String)public Date getCurrentDate()
DateTimeService
getCurrentDate in interface DateTimeServiceDateTimeService.getCurrentDate()public Timestamp getCurrentTimestamp()
DateTimeService
getCurrentTimestamp in interface DateTimeServiceDateTimeService.getCurrentTimestamp()public Date getCurrentSqlDate()
DateTimeService
getCurrentSqlDate in interface DateTimeServiceDateTimeService.getCurrentSqlDate()public Date getCurrentSqlDateMidnight()
DateTimeService
getCurrentSqlDateMidnight in interface DateTimeServiceDateTimeService.getCurrentSqlDateMidnight()public Calendar getCurrentCalendar()
DateTimeService
getCurrentCalendar in interface DateTimeServiceDateTimeService.getCurrentCalendar()public Calendar getCalendar(Date date)
DateTimeService
getCalendar in interface DateTimeServiceDateTimeService.getCalendar(java.util.Date)
public Date convertToDate(String dateString)
throws ParseException
convertToDate in interface DateTimeServiceParseExceptionDateTimeService.convertToDate(java.lang.String)
public Date convertToDateTime(String dateTimeString)
throws ParseException
DateTimeService
convertToDateTime in interface DateTimeServiceParseExceptionDateTimeService.convertToDateTime(java.lang.String)
public Timestamp convertToSqlTimestamp(String timeString)
throws ParseException
DateTimeService
convertToSqlTimestamp in interface DateTimeServiceParseException - if the string cannot be convertedDateTimeService.convertToSqlTimestamp(java.lang.String)
public Date convertToSqlDate(String dateString)
throws ParseException
DateTimeService
convertToSqlDate in interface DateTimeServiceParseException - if the string cannot be convertedDateTimeService.convertToSqlDate(java.lang.String)
protected Date parseAgainstFormatArray(String dateString,
String[] formats)
throws ParseException
ParseException
public Date convertToSqlDate(Timestamp timestamp)
throws ParseException
DateTimeService
convertToSqlDate in interface DateTimeServiceParseExceptionDateTimeService.convertToSqlDate(java.sql.Timestamp)
public int dateDiff(Date startDate,
Date endDate,
boolean inclusive)
DateTimeService
dateDiff in interface DateTimeServicestartDate - The first date in the periodendDate - The second date in the periodinclusive - Whether the result should include both the start and the end date. Otherwise it only includes one.
protected Date parse(String dateString,
String pattern)
throws ParseException
ParseExceptionpublic String toDateStringForFilename(Date date)
DateTimeService
toDateStringForFilename in interface DateTimeServiceDateTimeService.toDateStringForFilename(java.util.Date)public String toDateTimeStringForFilename(Date date)
DateTimeService
toDateTimeStringForFilename in interface DateTimeServiceDateTimeService.toDateTimeStringForFilename(java.util.Date)
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionInitializingBean.afterPropertiesSet()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||