Package org.beanio.types
Class BigIntegerTypeHandler
- java.lang.Object
-
- org.beanio.types.LocaleSupport
-
- org.beanio.types.NumberTypeHandler
-
- org.beanio.types.BigIntegerTypeHandler
-
- All Implemented Interfaces:
java.lang.Cloneable,ConfigurableTypeHandler,TypeHandler
public class BigIntegerTypeHandler extends NumberTypeHandler
A type handler implementation for theBigIntegerclass. Ifpatternis set, aDecimalFormatis used to parse and format the value. Otherwise, the value is parsed and formatted using theBigIntegerclass.- Since:
- 1.0
- See Also:
DecimalFormat
-
-
Field Summary
-
Fields inherited from class org.beanio.types.LocaleSupport
locale
-
Fields inherited from interface org.beanio.types.ConfigurableTypeHandler
FORMAT_SETTING
-
Fields inherited from interface org.beanio.types.TypeHandler
NIL
-
-
Constructor Summary
Constructors Constructor Description BigIntegerTypeHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.math.BigIntegercreateNumber(java.lang.String text)Parses aNumberfrom text.protected java.math.BigIntegercreateNumber(java.math.BigDecimal bg)Parses aNumberfrom aBigDecimal.java.lang.Class<?>getType()Returns the class type supported by this handler.-
Methods inherited from class org.beanio.types.NumberTypeHandler
createDecimalFormat, format, getPattern, newInstance, parse, setPattern
-
Methods inherited from class org.beanio.types.LocaleSupport
getLocale, setLocale
-
-
-
-
Method Detail
-
createNumber
protected java.math.BigInteger createNumber(java.lang.String text) throws java.lang.NumberFormatExceptionDescription copied from class:NumberTypeHandlerParses aNumberfrom text.- Specified by:
createNumberin classNumberTypeHandler- Parameters:
text- the text to convert to a Number- Returns:
- the parsed
Number - Throws:
java.lang.NumberFormatException- if the text is not a valid number
-
createNumber
protected java.math.BigInteger createNumber(java.math.BigDecimal bg) throws java.lang.ArithmeticExceptionDescription copied from class:NumberTypeHandlerParses aNumberfrom aBigDecimal.- Specified by:
createNumberin classNumberTypeHandler- Parameters:
bg- theBigDecimalversion of the number- Returns:
- the parsed
Number - Throws:
java.lang.ArithmeticException- if theBigDecimalcannot be converted to theNumbertype supported by this handler
-
getType
public java.lang.Class<?> getType()
Description copied from interface:TypeHandlerReturns the class type supported by this handler. Primitive types should not be returned by this method- use the object equivalent instead.- Returns:
- the class type supported by this handler
-
-