public class NumberConverter extends DefaultTypeConverter
MILLISECOND_FORMAT
NO_CONVERSION_POSSIBLE, TYPE_CONVERTER_CONTEXT_KEY
Constructor and Description |
---|
NumberConverter() |
Modifier and Type | Method and Description |
---|---|
protected Object |
convertToBigDecimal(Map<String,Object> context,
String stringValue) |
protected Object |
convertToDouble(Map<String,Object> context,
String stringValue) |
protected Object |
convertToFloat(Map<String,Object> context,
String stringValue) |
Object |
convertValue(Map<String,Object> context,
Object target,
Member member,
String propertyName,
Object value,
Class toType)
Converts the given value to a given type.
|
protected NumberFormat |
getNumberFormat(Locale locale) |
protected boolean |
isInRange(Number value,
String stringValue,
Class toType) |
protected String |
normalize(String strValue,
char separator) |
bigDecValue, bigIntValue, booleanValue, convertValue, convertValue, doubleValue, enumValue, getLocale, getTypeConverter, longValue, setContainer, stringValue, stringValue
public Object convertValue(Map<String,Object> context, Object target, Member member, String propertyName, Object value, Class toType)
TypeConverter
convertValue
in interface TypeConverter
convertValue
in class DefaultTypeConverter
context
- context under which the conversion is being donetarget
- target object in which the property is being setmember
- member (Constructor, Method or Field) being setpropertyName
- property name being setvalue
- value to be convertedtoType
- type to which value is convertedprotected Object convertToBigDecimal(Map<String,Object> context, String stringValue)
protected NumberFormat getNumberFormat(Locale locale)
Copyright © 2000–2020 Apache Software Foundation. All rights reserved.