Constructors Summary |
---|
public DateFormatManager()
//--------------------------------------------------------------------------
// Constructors:
//--------------------------------------------------------------------------
super();
configure();
|
public DateFormatManager(TimeZone timeZone)
super();
_timeZone = timeZone;
configure();
|
public DateFormatManager(Locale locale)
super();
_locale = locale;
configure();
|
public DateFormatManager(String pattern)
super();
_pattern = pattern;
configure();
|
public DateFormatManager(TimeZone timeZone, Locale locale)
super();
_timeZone = timeZone;
_locale = locale;
configure();
|
public DateFormatManager(TimeZone timeZone, String pattern)
super();
_timeZone = timeZone;
_pattern = pattern;
configure();
|
public DateFormatManager(Locale locale, String pattern)
super();
_locale = locale;
_pattern = pattern;
configure();
|
public DateFormatManager(TimeZone timeZone, Locale locale, String pattern)
super();
_timeZone = timeZone;
_locale = locale;
_pattern = pattern;
configure();
|
Methods Summary |
---|
private synchronized void | configure()
_dateFormat = SimpleDateFormat.getDateTimeInstance(DateFormat.FULL,
DateFormat.FULL,
getLocale());
_dateFormat.setTimeZone(getTimeZone());
if (_pattern != null) {
((SimpleDateFormat) _dateFormat).applyPattern(_pattern);
}
|
public java.lang.String | format(java.util.Date date)
return getDateFormatInstance().format(date);
|
public java.lang.String | format(java.util.Date date, java.lang.String pattern)
DateFormat formatter = null;
formatter = getDateFormatInstance();
if (formatter instanceof SimpleDateFormat) {
formatter = (SimpleDateFormat) (formatter.clone());
((SimpleDateFormat) formatter).applyPattern(pattern);
}
return formatter.format(date);
|
public synchronized java.text.DateFormat | getDateFormatInstance()
return _dateFormat;
|
public synchronized java.util.Locale | getLocale()
if (_locale == null) {
return Locale.getDefault();
} else {
return _locale;
}
|
public synchronized java.lang.String | getOutputFormat()This method has been deprecated in favour of getPattern().
return _pattern;
|
public synchronized java.lang.String | getPattern()
return _pattern;
|
public synchronized java.util.TimeZone | getTimeZone()
if (_timeZone == null) {
return TimeZone.getDefault();
} else {
return _timeZone;
}
|
public java.util.Date | parse(java.lang.String date)
return getDateFormatInstance().parse(date);
|
public java.util.Date | parse(java.lang.String date, java.lang.String pattern)
DateFormat formatter = null;
formatter = getDateFormatInstance();
if (formatter instanceof SimpleDateFormat) {
formatter = (SimpleDateFormat) (formatter.clone());
((SimpleDateFormat) formatter).applyPattern(pattern);
}
return formatter.parse(date);
|
public synchronized void | setDateFormatInstance(java.text.DateFormat dateFormat)
_dateFormat = dateFormat;
// No reconfiguration necessary!
|
public synchronized void | setLocale(java.util.Locale locale)
_locale = locale;
configure();
|
public synchronized void | setOutputFormat(java.lang.String pattern)This method has been deprecated in favour of setPattern().
_pattern = pattern;
configure();
|
public synchronized void | setPattern(java.lang.String pattern)Set the pattern. i.e. "EEEEE, MMMMM d, yyyy hh:mm aaa"
_pattern = pattern;
configure();
|
public synchronized void | setTimeZone(java.util.TimeZone timeZone)
_timeZone = timeZone;
configure();
|