org.apache.commons.convert
Class NumberConverters

java.lang.Object
  extended by org.apache.commons.convert.NumberConverters
All Implemented Interfaces:
ConverterLoader

public class NumberConverters
extends Object
implements ConverterLoader

Number Converter classes.


Nested Class Summary
static class NumberConverters.AbstractNumberToStringConverter<N extends Number>
          An abstract Number to String converter class that implements some of the LocalizedConverter methods.
static class NumberConverters.AbstractStringToNumberConverter<N extends Number>
          An abstract String to Number converter class that implements some of the LocalizedConverter methods.
static class NumberConverters.BigDecimalToString
          An object that converts a BigDecimal to a String.
static class NumberConverters.BigIntegerToString
          An object that converts a BigInteger to a String.
static class NumberConverters.ByteToString
          An object that converts a Byte to a String.
static class NumberConverters.DoubleToString
          An object that converts a Double to a String.
static class NumberConverters.FloatToString
          An object that converts a Float to a String.
static class NumberConverters.GenericNumberToBigDecimal<N extends Number>
          An object that converts a Number to a BigDecimal.
static class NumberConverters.GenericNumberToBigInteger<N extends Number>
          An object that converts a Number to a BigInteger.
static class NumberConverters.GenericNumberToByte<N extends Number>
          An object that converts a Number to a Byte.
static class NumberConverters.GenericNumberToDouble<N extends Number>
          An object that converts a Number to a Double.
static class NumberConverters.GenericNumberToFloat<N extends Number>
          An object that converts a Number to a Float.
static class NumberConverters.GenericNumberToInteger<N extends Number>
          An object that converts a Number to an Integer.
static class NumberConverters.GenericNumberToLong<N extends Number>
          An object that converts a Number to a Long.
static class NumberConverters.GenericNumberToShort<N extends Number>
          An object that converts a Number to a Short.
static class NumberConverters.IntegerToString
          An object that converts an Integer to a String.
static class NumberConverters.LongToBigDecimal
          An object that converts a Long to a BigDecimal.
static class NumberConverters.LongToString
          An object that converts a Long to a String.
static class NumberConverters.ShortToString
          An object that converts a Short to a String.
static class NumberConverters.StringToBigDecimal
          An object that converts a String to a BigDecimal.
static class NumberConverters.StringToBigInteger
          An object that converts a String to a BigInteger.
static class NumberConverters.StringToByte
          An object that converts a String to a Byte.
static class NumberConverters.StringToDouble
          An object that converts a String to a Double.
static class NumberConverters.StringToFloat
          An object that converts a String to a Float.
static class NumberConverters.StringToInteger
          An object that converts a String to an Integer.
static class NumberConverters.StringToLong
          An object that converts a String to a Long.
static class NumberConverters.StringToShort
          An object that converts a String to a Short.
 
Field Summary
protected static Class<?>[] classArray
           
 
Constructor Summary
NumberConverters()
           
 
Method Summary
protected static Number fromString(String str, NumberFormat nf)
           
 void loadConverters()
          Create and register converters with the Java object type conversion framework.
protected static
<S,T> void
registerConverter(Converter<S,T> converter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classArray

protected static final Class<?>[] classArray
Constructor Detail

NumberConverters

public NumberConverters()
Method Detail

fromString

protected static Number fromString(String str,
                                   NumberFormat nf)
                            throws ConversionException
Throws:
ConversionException

registerConverter

protected static <S,T> void registerConverter(Converter<S,T> converter)

loadConverters

public void loadConverters()
Description copied from interface: ConverterLoader
Create and register converters with the Java object type conversion framework. If the converter extends one of the converter abstract classes, then the converter will register itself when an instance is created. Otherwise, call Converters.registerConverter(Converter) with the Converter instance.

Specified by:
loadConverters in interface ConverterLoader


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