public class BigIntegerConverter extends Object implements Converter<BigInteger,DecimalFormat>
Constructor and Description |
---|
BigIntegerConverter() |
Modifier and Type | Method and Description |
---|---|
DecimalFormat |
configure(String format,
long flags,
ColumnInfo<BigInteger> fieldInfo)
Configure this instance of the converter based on the associated params.
|
static BigIntegerConverter |
getSingleton()
Get singleton for class.
|
boolean |
isAlwaysTrimInput()
Returns true if the field should trim the string before it is passed to
Converter.stringToJava(String, int, int, ColumnInfo, String, ParseError) . |
boolean |
isNeedsQuotes(DecimalFormat decimalFormat)
Returns true if the field needs to be quoted in the CSV output.
|
String |
javaToString(ColumnInfo<BigInteger> columnInfo,
BigInteger value)
Converts from a Java representation to string.
|
BigInteger |
stringToJava(String line,
int lineNumber,
int linePos,
ColumnInfo<BigInteger> columnInfo,
String value,
ParseError parseError)
Converts from a string representation to Java.
|
public static BigIntegerConverter getSingleton()
public DecimalFormat configure(String format, long flags, ColumnInfo<BigInteger> fieldInfo)
Converter
configure
in interface Converter<BigInteger,DecimalFormat>
format
- Optional string format which affects the output and parsing of the field. Null if none supplied in
which case the default format is used.flags
- Optional numerical flags which affect the output and parsing of the field. 0 if no flags supplied.fieldInfo
- Information about the field associated with this converter.public boolean isNeedsQuotes(DecimalFormat decimalFormat)
Converter
isNeedsQuotes
in interface Converter<BigInteger,DecimalFormat>
public boolean isAlwaysTrimInput()
Converter
Converter.stringToJava(String, int, int, ColumnInfo, String, ParseError)
.isAlwaysTrimInput
in interface Converter<BigInteger,DecimalFormat>
public String javaToString(ColumnInfo<BigInteger> columnInfo, BigInteger value)
Converter
javaToString
in interface Converter<BigInteger,DecimalFormat>
columnInfo
- Information about the column we are processing.value
- Value of the field that we are converting.public BigInteger stringToJava(String line, int lineNumber, int linePos, ColumnInfo<BigInteger> columnInfo, String value, ParseError parseError) throws ParseException
Converter
stringToJava
in interface Converter<BigInteger,DecimalFormat>
line
- Line we are processing for logging purposes.lineNumber
- Number of the line we are processing for logging purposes.linePos
- Position in the line that we are converting to identify what part of the line contains the value.columnInfo
- Information about the column we are processing.value
- Value of the field that we are converting.parseError
- Parse error which can we use to set information about parse errors here. If there are no parse errors
then just ignore this field. Any exceptions thrown will also be caught and interpreted as errors.ParseError.ErrorType.NONE
.ParseException
- If there was some sort of parse or other error. It is better to return null and use the parseError
argument instead. All RuntimeExceptions will be caught as well.This documentation content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.