org.apache.commons.convert
Class NumberConverters.AbstractNumberToStringConverter<N extends Number>
java.lang.Object
org.apache.commons.convert.AbstractConverter<S,T>
org.apache.commons.convert.AbstractLocalizedConverter<N,String>
org.apache.commons.convert.NumberConverters.AbstractNumberToStringConverter<N>
- All Implemented Interfaces:
- Converter<N,String>, ConverterLoader, LocalizedConverter<N,String>
- Direct Known Subclasses:
- NumberConverters.BigDecimalToString, NumberConverters.BigIntegerToString, NumberConverters.ByteToString, NumberConverters.DoubleToString, NumberConverters.FloatToString, NumberConverters.IntegerToString, NumberConverters.LongToString, NumberConverters.ShortToString
- Enclosing class:
- NumberConverters
public abstract static class NumberConverters.AbstractNumberToStringConverter<N extends Number>
- extends AbstractLocalizedConverter<N,String>
An abstract Number
to String
converter class
that implements some of the LocalizedConverter
methods.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NumberConverters.AbstractNumberToStringConverter
public NumberConverters.AbstractNumberToStringConverter(Class<N> sourceClass)
convert
public String convert(N obj)
throws ConversionException
- Description copied from interface:
Converter
- Converts
obj
to T
.
- Parameters:
obj
- The source Object
to convert
- Returns:
- The converted
Object
- Throws:
ConversionException
convert
public String convert(N obj,
Locale locale,
TimeZone timeZone,
String formatString)
throws ConversionException
- Description copied from interface:
LocalizedConverter
- Converts
obj
to T
.
- Parameters:
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
- Returns:
- The converted
Object
- Throws:
ConversionException
format
protected abstract String format(N obj,
NumberFormat nf)
throws ConversionException
- Throws:
ConversionException
Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.