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 Details

    • convert

      public T convert(Class<? extends T> targetClass, S obj, Locale locale, TimeZone timeZone) throws ConversionException
      Description copied from interface: LocalizedConverter
      Converts obj to T.
      Specified by:
      convert in interface LocalizedConverter<S,T>
      Parameters:
      targetClass - The Class to convert to
      obj - The source Object to convert
      locale - The locale used for conversion - must not be null
      timeZone - The time zone used for conversion - must not be null
      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
      Converts obj to T.
      Specified by:
      convert in interface LocalizedConverter<S,T>
      Parameters:
      targetClass - The Class to convert to
      obj - The source Object to convert
      locale - The locale used for conversion - must not be null
      timeZone - The time zone used for conversion - must not be null
      formatString - Optional formatting string
      Returns:
      The converted Object
      Throws:
      ConversionException