Package org.apache.ofbiz.base.conversion
Class AbstractLocalizedConverter<S,T>
java.lang.Object
org.apache.ofbiz.base.conversion.AbstractConverter<S,T>
org.apache.ofbiz.base.conversion.AbstractLocalizedConverter<S,T>
- All Implemented Interfaces:
Converter<S,
,T> ConverterLoader
,LocalizedConverter<S,
T>
- Direct Known Subclasses:
DateTimeConverters.GenericLocalizedConverter
,DateTimeConverters.LongToCalendar
,DateTimeConverters.StringToCalendar
,DateTimeConverters.StringToDuration
,NumberConverters.AbstractNumberConverter
public abstract class AbstractLocalizedConverter<S,T>
extends AbstractConverter<S,T>
implements LocalizedConverter<S,T>
Abstract LocalizedConverter class. This class handles converter registration
and it implements the
canConvert
, getSourceClass
,
and getTargetClass
methods.-
Method Summary
Methods inherited from class org.apache.ofbiz.base.conversion.AbstractConverter
canConvert, convert, getSourceClass, getTargetClass, loadConverters
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.ofbiz.base.conversion.Converter
canConvert, convert, convert, getSourceClass, getTargetClass
Methods inherited from interface org.apache.ofbiz.base.conversion.LocalizedConverter
convert, convert
-
Method Details
-
convert
public T convert(Class<? extends T> targetClass, S obj, Locale locale, TimeZone timeZone) throws ConversionException Description copied from interface:LocalizedConverter
Convertsobj
toT
.- Specified by:
convert
in interfaceLocalizedConverter<S,
T> - Parameters:
targetClass
- TheClass
to convert toobj
- The sourceObject
to convertlocale
- The locale used for conversion - must not benull
timeZone
- The time zone used for conversion - must not benull
- Returns:
- The converted
Object
- Throws:
ConversionException
-
convert
public T convert(Class<? extends T> targetClass, S obj, Locale locale, TimeZone timeZone, String formatString) throws ConversionException Description copied from interface:LocalizedConverter
Convertsobj
toT
.- Specified by:
convert
in interfaceLocalizedConverter<S,
T> - Parameters:
targetClass
- TheClass
to convert toobj
- The sourceObject
to convertlocale
- The locale used for conversion - must not benull
timeZone
- The time zone used for conversion - must not benull
formatString
- Optional formatting string- Returns:
- The converted
Object
- Throws:
ConversionException
-