org.apache.commons.convert
Class NumberConverters.AbstractStringToNumberConverter<N extends Number>
java.lang.Object
org.apache.commons.convert.AbstractConverter<S,T>
org.apache.commons.convert.AbstractLocalizedConverter<String,N>
org.apache.commons.convert.NumberConverters.AbstractStringToNumberConverter<N>
- All Implemented Interfaces:
- Converter<String,N>, ConverterLoader, LocalizedConverter<String,N>
- Direct Known Subclasses:
- NumberConverters.StringToBigDecimal, NumberConverters.StringToBigInteger, NumberConverters.StringToDouble, NumberConverters.StringToFloat, NumberConverters.StringToInteger, NumberConverters.StringToLong
- Enclosing class:
- NumberConverters
public abstract static class NumberConverters.AbstractStringToNumberConverter<N extends Number>
- extends AbstractLocalizedConverter<String,N>
An abstract String
to Number
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.AbstractStringToNumberConverter
public NumberConverters.AbstractStringToNumberConverter(Class<N> targetClass)
convert
protected abstract N convert(Number number)
throws ConversionException
- Throws:
ConversionException
convert
public N convert(String 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
Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.