|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.base.Adaptee
org.norther.tammi.core.converter.DefaultObjectConverter
org.norther.tammi.core.converter.DefaultDateConverter
public class DefaultDateConverter
A default implementation of DateConverter.
| Field Summary |
|---|
| Fields inherited from class org.norther.tammi.core.base.Adaptee |
|---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
| Fields inherited from interface org.norther.tammi.core.converter.DateConverter |
|---|
DEFAULT_STYLE, FULL_STYLE, LONG_STYLE, MEDIUM_STYLE, SHORT_STYLE |
| Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate |
|---|
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE |
| Constructor Summary | |
|---|---|
DefaultDateConverter()
Constructs a new converter. |
|
| Method Summary | |
|---|---|
Set |
classNameSet()
Returns a read-only set of class names of defined patterns. |
void |
clearClassSpecificPatterns()
Clears all class specific patterns. |
void |
clearLocalPatternChars()
Clears all locale specific pattern chars. |
String |
getClassSpecificPattern(String className)
Gets the class specific default date pattern. |
DateFormat |
getDateFormat(String pattern)
Gets a date format for the specified pattern. |
DateFormat |
getDateFormat(String pattern,
Locale locale)
Gets a date format for the specified pattern and locale. |
DateFormat |
getDateFormat(String className,
String pattern)
Gets a date format for the specified class and pattern. |
DateFormat |
getDateFormat(String className,
String pattern,
Locale locale)
Gets a date format for the specified class, pattern and locale. |
String |
getDefaultPattern()
Gets the default date pattern. |
String |
getFormatPattern(String className,
String pattern,
Locale locale)
Gets the format pattern. |
Object |
getInstance(String className,
Object object,
String pattern,
Object minValue,
Object maxValue)
Gets an instance of the named class by converting the source object and optionally applying the specified pattern and limits. |
Object |
getInstance(String className,
Object object,
String pattern,
Object minValue,
Object maxValue,
Locale locale,
ResourceBundle bundle)
Gets an instance of the named class by converting the localized source resource and optionally applying the specified pattern and limits. |
protected DateFormatSymbols |
getLocalFormatSymbols(Locale locale)
Gets the locale specific format symbols. |
String |
getLocalizedPattern(String className,
String pattern,
Locale locale)
Gets the localized format pattern. |
String |
getLocalPatternChars(Locale locale)
Gets the locale specific pattern chars. |
String |
getTimeZoneId()
Gets the default time zone to apply. |
boolean |
isConversionSupported(String className)
Checks whether conversion of the specified class is supported. |
Set |
patternLocaleSet()
Returns a read-only set of locales with defined pattern chars. |
void |
removeClassSpecificPattern(String className)
Removes the class specific default date pattern. |
void |
removeLocalPatternChars(Locale locale)
Removes the locale specific pattern chars. |
void |
setClassSpecificPattern(String className,
String pattern)
Sets the class specific default date pattern. |
void |
setDefaultPattern(String pattern)
Sets the default date pattern. |
void |
setLocalPatternChars(Locale locale,
String chars)
Sets the locale specific pattern chars. |
void |
setTimeZoneId(String id)
Sets the default time zone to apply. |
List |
timeZoneIds()
Returns a list of supported time zone ids. |
Date |
toDate(long msecs)
Converts milliseconds to date. |
String |
toString(String className,
Object object,
String pattern)
Returns a string representation of an object of the named class by optionally applying the specified pattern. |
String |
toString(String className,
Object object,
String pattern,
Locale locale,
ResourceBundle bundle)
Returns a localized resource of the named class by optionally applying the specified pattern. |
long |
toTime(Date date)
Converts a date to milliseconds. |
| Methods inherited from class org.norther.tammi.core.converter.DefaultObjectConverter |
|---|
fromLocalizedObject, getComponentInstance, getInstance, getResourceFinderName, postmanaged, setResourceFinderName, toComponentString, toLocalizedObject, toString, toStrings, toStrings, toStrings, unmanaged |
| Methods inherited from class org.norther.tammi.core.base.Adaptee |
|---|
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.norther.tammi.core.converter.ObjectConverter |
|---|
getInstance, getResourceFinderName, setResourceFinderName, toString, toStrings, toStrings, toStrings |
| Constructor Detail |
|---|
public DefaultDateConverter()
| Method Detail |
|---|
public String getDefaultPattern()
DateConverter
getDefaultPattern in interface DateConverterpublic void setDefaultPattern(String pattern)
DateConverter
setDefaultPattern in interface DateConverterpattern - the default date pattern.public String getClassSpecificPattern(String className)
DateConverter
getClassSpecificPattern in interface DateConverterclassName - the class name of the pattern.
public void setClassSpecificPattern(String className,
String pattern)
DateConverter
setClassSpecificPattern in interface DateConverterclassName - the class name of the pattern.pattern - the class specific default date pattern.public void removeClassSpecificPattern(String className)
DateConverter
removeClassSpecificPattern in interface DateConverterclassName - the class name of the pattern.public void clearClassSpecificPatterns()
DateConverter
clearClassSpecificPatterns in interface DateConverterpublic Set classNameSet()
DateConverter
classNameSet in interface DateConverterpublic String getLocalPatternChars(Locale locale)
DateConverter
getLocalPatternChars in interface DateConverterlocale - the locale.
public void setLocalPatternChars(Locale locale,
String chars)
DateConverter
setLocalPatternChars in interface DateConverterlocale - the locale.chars - the pattern chars.public void removeLocalPatternChars(Locale locale)
DateConverter
removeLocalPatternChars in interface DateConverterlocale - the locale.public void clearLocalPatternChars()
DateConverter
clearLocalPatternChars in interface DateConverterpublic Set patternLocaleSet()
DateConverter
patternLocaleSet in interface DateConverterpublic String getTimeZoneId()
DateConverter
getTimeZoneId in interface DateConverterpublic void setTimeZoneId(String id)
DateConverterNote that this method changes the default time zone of the running JVM to the specified value and thus may interfere with other date functionality.
setTimeZoneId in interface DateConverterid - the time zone id.public List timeZoneIds()
DateConverter
timeZoneIds in interface DateConverterpublic DateFormat getDateFormat(String pattern)
DateConverter
getDateFormat in interface DateConverterpattern - the pattern.
DateFormat
public DateFormat getDateFormat(String pattern,
Locale locale)
DateConverter
getDateFormat in interface DateConverterpattern - the pattern.locale - the locale.
DateFormat
public DateFormat getDateFormat(String className,
String pattern)
DateConverter
getDateFormat in interface DateConverterclassName - the name of the class to format.pattern - the pattern.
DateFormat
public DateFormat getDateFormat(String className,
String pattern,
Locale locale)
DateConverter
getDateFormat in interface DateConverterclassName - the name of the class to format.pattern - the pattern.locale - the locale.
DateFormatpublic long toTime(Date date)
DateConverter
toTime in interface DateConverterdate - the date.
public Date toDate(long msecs)
DateConverter
toDate in interface DateConvertermsecs - the millis.
public Object getInstance(String className,
Object object,
String pattern,
Object minValue,
Object maxValue)
throws ConversionException
ObjectConverter
getInstance in interface ObjectConvertergetInstance in class DefaultObjectConverterclassName - the name of the class.object - the source object.pattern - an optional conversion pattern.minValue - an optional minimum value.maxValue - an optional maximum value.
ConversionException - if conversion fails.
public Object getInstance(String className,
Object object,
String pattern,
Object minValue,
Object maxValue,
Locale locale,
ResourceBundle bundle)
throws ConversionException
ObjectConverter
getInstance in interface ObjectConvertergetInstance in class DefaultObjectConverterclassName - the name of the class.object - the source object.pattern - an optional conversion pattern.minValue - an optional minimum value.maxValue - an optional maximum value.locale - the locale of the source object.bundle - the resource bundle to apply.
ConversionException - if conversion fails.
public String toString(String className,
Object object,
String pattern)
ObjectConverter
toString in interface ObjectConvertertoString in class DefaultObjectConverterclassName - the name of the class.object - the source object.pattern - an optional conversion pattern.
public String toString(String className,
Object object,
String pattern,
Locale locale,
ResourceBundle bundle)
ObjectConverter
toString in interface ObjectConvertertoString in class DefaultObjectConverterclassName - the name of the class.object - the source object.pattern - the conversion pattern.locale - the optional locale of the result.bundle - the resource bundle to apply.
public boolean isConversionSupported(String className)
ObjectConverter
isConversionSupported in interface ObjectConverterisConversionSupported in class DefaultObjectConverterclassName - the class name.
public String getFormatPattern(String className,
String pattern,
Locale locale)
ObjectConverter
getFormatPattern in interface ObjectConvertergetFormatPattern in class DefaultObjectConverterclassName - the class name.pattern - the conversion pattern.locale - an optional locale to apply.
public String getLocalizedPattern(String className,
String pattern,
Locale locale)
ObjectConverter
getLocalizedPattern in interface ObjectConvertergetLocalizedPattern in class DefaultObjectConverterclassName - the class name.pattern - the conversion pattern.locale - an optional locale to apply.
protected DateFormatSymbols getLocalFormatSymbols(Locale locale)
locale - the locale.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||