org.apache.commons.convert
Class AbstractLocalizedConverter<S,T>

java.lang.Object
  extended by org.apache.commons.convert.AbstractConverter<S,T>
      extended by org.apache.commons.convert.AbstractLocalizedConverter<S,T>
All Implemented Interfaces:
Converter<S,T>, ConverterLoader, LocalizedConverter<S,T>
Direct Known Subclasses:
DateTimeConverters.CalendarToString, DateTimeConverters.DateToString, DateTimeConverters.GenericLocalizedConverter, DateTimeConverters.LongToCalendar, DateTimeConverters.SqlDateToString, DateTimeConverters.SqlTimeToString, DateTimeConverters.StringToCalendar, DateTimeConverters.StringToDate, DateTimeConverters.StringToSqlDate, DateTimeConverters.StringToSqlTime, DateTimeConverters.StringToTimestamp, DateTimeConverters.TimestampToString, NumberConverters.AbstractNumberToStringConverter, NumberConverters.AbstractStringToNumberConverter

public abstract class AbstractLocalizedConverter<S,T>
extends AbstractConverter<S,T>
implements LocalizedConverter<S,T>

Abstract localized converter class. This class handles converter registration and it implements some of the Converter methods.


Constructor Summary
protected AbstractLocalizedConverter(Class<? super S> sourceClass, Class<? super T> targetClass)
           
 
Method Summary
 T convert(S obj, Locale locale, TimeZone timeZone)
          Converts obj to T.
 
Methods inherited from class org.apache.commons.convert.AbstractConverter
canConvert, 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.commons.convert.LocalizedConverter
convert
 
Methods inherited from interface org.apache.commons.convert.Converter
canConvert, convert, getSourceClass, getTargetClass
 

Constructor Detail

AbstractLocalizedConverter

protected AbstractLocalizedConverter(Class<? super S> sourceClass,
                                     Class<? super T> targetClass)
Method Detail

convert

public T convert(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:
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


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.