|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LocalizedConverter<S,T>
Localized converter interface. Classes implement this interface to convert one object type to another. Methods are provided to localize the conversion.
Localized converters are necessary for things like dates, times, and numbers. Those
conversions are dependent on a locale and/or time zone. Java's default conversions
(toString
, valueOf
) use the JVM's default locale and
time zone - which might not be what the application requires. Implementations of
LocalizedConverter
will use the specified locale and time zone instead of
the JVM defaults.
Method Summary | |
---|---|
T |
convert(S obj,
Locale locale,
TimeZone timeZone)
Converts obj to T . |
T |
convert(S obj,
Locale locale,
TimeZone timeZone,
String formatString)
Converts obj to T . |
Methods inherited from interface org.apache.commons.convert.Converter |
---|
canConvert, convert, getSourceClass, getTargetClass |
Method Detail |
---|
T convert(S obj, Locale locale, TimeZone timeZone) throws ConversionException
obj
to T
.
obj
- The source Object
to convertlocale
- The locale used for conversion - must not be null
timeZone
- The time zone used for conversion - must not be null
Object
ConversionException
T convert(S obj, Locale locale, TimeZone timeZone, String formatString) throws ConversionException
obj
to T
.
obj
- The source Object
to convertlocale
- The locale used for conversion - must not be null
timeZone
- The time zone used for conversion - must not be null
formatString
- Optional formatting string
Object
ConversionException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |