BeanIO 1.2.3

org.beanio.types
Class BigIntegerTypeHandler

java.lang.Object
  extended by org.beanio.types.NumberTypeHandler
      extended by org.beanio.types.BigIntegerTypeHandler
All Implemented Interfaces:
Cloneable, ConfigurableTypeHandler, TypeHandler

public class BigIntegerTypeHandler
extends NumberTypeHandler

A type handler implementation for the BigInteger class. If pattern is set, a DecimalFormat is used to parse and format the value. Otherwise, the value is parsed and formatted using the BigInteger class.

Since:
1.0
Author:
Kevin Seim
See Also:
DecimalFormat

Field Summary
 
Fields inherited from interface org.beanio.types.ConfigurableTypeHandler
FORMAT_SETTING
 
Fields inherited from interface org.beanio.types.TypeHandler
NIL
 
Constructor Summary
BigIntegerTypeHandler()
           
 
Method Summary
protected  BigInteger createNumber(BigDecimal bg)
          Parses a Number from a BigDecimal.
protected  BigInteger createNumber(String text)
          Parses a Number from text.
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BigIntegerTypeHandler

public BigIntegerTypeHandler()
Method Detail

createNumber

protected BigInteger createNumber(String text)
                           throws NumberFormatException
Description copied from class: NumberTypeHandler
Parses a Number from text.

Specified by:
createNumber in class NumberTypeHandler
Parameters:
text - the text to convert to a Number
Returns:
the parsed Number
Throws:
NumberFormatException - if the text is not a valid number

createNumber

protected BigInteger createNumber(BigDecimal bg)
                           throws ArithmeticException
Description copied from class: NumberTypeHandler
Parses a Number from a BigDecimal.

Specified by:
createNumber in class NumberTypeHandler
Parameters:
bg - the BigDecimal version of the number
Returns:
the parsed Number
Throws:
ArithmeticException - if the BigDecimal cannot be converted to the Number type supported by this handler

getType

public Class<?> getType()
Description copied from interface: TypeHandler
Returns 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

BeanIO 1.2.3

Copyright © 2010-2012 Kevin Seim