public class BigDecimalTypeConverter extends NumberTypeConverterSupport implements TypeConverter<BigDecimal>
| Constructor and Description |
|---|
BigDecimalTypeConverter() |
| Modifier and Type | Method and Description |
|---|---|
BigDecimal |
convert(String input,
Class<? extends BigDecimal> targetType,
Collection<ValidationError> errors)
Implemented to parse a BigDecimal using the parse() support method.
|
protected NumberFormat[] |
getNumberFormats()
Uses the parent implementation to fetch number formats, but then downcasts it
to a decimal format and ensures that a BigDecimal is parsed instead of a Long or
Double.
|
getLocale, parse, preprocess, setLocaleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetLocaleprotected NumberFormat[] getNumberFormats()
getNumberFormats in class NumberTypeConverterSupportpublic BigDecimal convert(String input, Class<? extends BigDecimal> targetType, Collection<ValidationError> errors)
convert in interface TypeConverter<BigDecimal>input - the String being convertedtargetType - the Class representing the type of the property to which the return
value of the conversion will be assigned. In many cases this can be ignored as
converters will return a single type more often than not.errors - an empty collection of validation errors that should be populated by the
converter for any errors that occur during validation that are user input related.© Copyright 2005-2006, Stripes Development Team.