Top Description Inners Constructors Methods
org.springframework.core.convert.support

pack-priv final Class CharacterToNumberFactory

extends Object
implements ConverterFactory<Character, Number>
Class Inheritance
All Implemented Interfaces
org.springframework.core.convert.converter.ConverterFactory
Imports
org.springframework.core.convert.converter.Converter, .ConverterFactory, org.springframework.util.NumberUtils

Converts from a Character to any JDK-standard Number implementation.

Support Number classes including Byte, Short, Integer, Float, Double, Long, BigInteger, BigDecimal. This class delegates to NumberUtils#convertNumberToTargetClass(Number, Class) to perform the conversion.

Author
Keith Donald
Since
3.0
See Also
java.lang.Byte, java.lang.Short, java.lang.Integer, java.lang.Long, java.math.BigInteger, java.lang.Float, java.lang.Double, java.math.BigDecimal, NumberUtils

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public <T extends Number> Converter<Character, T>
getConverter(Class<T>
the target type to convert to
targetType
)

Implements org.springframework.core.convert.converter.ConverterFactory.getConverter.

Get the converter to convert from S to target type T, where T is also an instance of R.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

CharacterToNumberFactoryback to summary
pack-priv CharacterToNumberFactory()

Method Detail

getConverterback to summary
public <T extends Number> Converter<Character, T> getConverter(Class<T> targetType)

Implements org.springframework.core.convert.converter.ConverterFactory.getConverter.

Doc from org.springframework.core.convert.converter.ConverterFactory.getConverter.

Get the converter to convert from S to target type T, where T is also an instance of R.

Parameters
<T>
the target type
targetType:Class<T>

the target type to convert to

Returns:Converter<Character, T>

a converter from S to T

Annotations
@Override
org.springframework.core.convert.support back to summary

private final Class CharacterToNumberFactory.CharacterToNumber<T extends Number>

extends Object
implements Converter<Character, T extends Number>
Class Inheritance
  • java.lang.Object
  • org.springframework.core.convert.support.CharacterToNumberFactory.CharacterToNumber
All Implemented Interfaces
org.springframework.core.convert.converter.Converter

Field Summary

Modifier and TypeField and Description
private final Class<T>

Constructor Summary

AccessConstructor and Description
public
CharacterToNumber(Class<T> targetType)

Method Summary

Modifier and TypeMethod and Description
public T
convert(Character
the source object to convert, which must be an instance of S (never null)
source
)

Implements org.springframework.core.convert.converter.Converter.convert.

Convert the source object of type S to target type T.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

targetTypeback to summary
private final Class<T> targetType

Constructor Detail

CharacterToNumberback to summary
public CharacterToNumber(Class<T> targetType)

Method Detail

convertback to summary
public T convert(Character source)

Implements org.springframework.core.convert.converter.Converter.convert.

Doc from org.springframework.core.convert.converter.Converter.convert.

Convert the source object of type S to target type T.

Parameters
source:Character

the source object to convert, which must be an instance of S (never null)

Returns:T

the converted object, which must be an instance of T (potentially null)

Annotations
@Override