Package org.smooks.engine.converter
Class NumberTypeConverter<S,T>
- java.lang.Object
-
- org.smooks.engine.converter.LocaleAwareTypeConverter<S,T>
-
- org.smooks.engine.converter.NumberTypeConverter<S,T>
-
- All Implemented Interfaces:
TypeConverter<S,T>
,Configurable
- Direct Known Subclasses:
NumberToStringConverter
,StringToDoubleConverterFactory.StringToDoubleTypeConverter
public abstract class NumberTypeConverter<S,T> extends LocaleAwareTypeConverter<S,T>
AbstractNumber
based DataDecoder.- Author:
- tom.fennelly@gmail.com
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NumberTypeConverter.NumberType
-
Field Summary
Fields Modifier and Type Field Description static String
FORMAT
protected NumberFormat
numberFormat
static String
TYPE
-
Fields inherited from class org.smooks.engine.converter.LocaleAwareTypeConverter
LOCALE, LOCALE_COUNTRY_CODE, LOCALE_LANGUAGE_CODE, VERIFY_LOCALE
-
-
Constructor Summary
Constructors Constructor Description NumberTypeConverter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description T
convert(S value)
protected abstract T
doConvert(S value)
NumberFormat
getNumberFormat()
Get theNumberFormat
instance, if one exists.NumberTypeConverter.NumberType
getType()
boolean
isPercentage()
void
setConfiguration(Properties properties)
Set the component configuration.-
Methods inherited from class org.smooks.engine.converter.LocaleAwareTypeConverter
getConfiguration, getLocale, getLocale, isLocalInstalled
-
-
-
-
Field Detail
-
FORMAT
public static final String FORMAT
- See Also:
- Constant Field Values
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
numberFormat
protected NumberFormat numberFormat
-
-
Method Detail
-
setConfiguration
public void setConfiguration(Properties properties) throws SmooksConfigException
Description copied from interface:Configurable
Set the component configuration.- Specified by:
setConfiguration
in interfaceConfigurable
- Overrides:
setConfiguration
in classLocaleAwareTypeConverter<S,T>
- Parameters:
properties
- The component configuration properties.- Throws:
SmooksConfigException
- Bad component configuration.
-
getNumberFormat
public NumberFormat getNumberFormat()
Get theNumberFormat
instance, if one exists.- Returns:
- A clone of the
NumberFormat
instance, otherwise null.
-
getType
public NumberTypeConverter.NumberType getType()
-
isPercentage
public boolean isPercentage()
-
-