Top Description Fields Constructors Methods
com.fasterxml.jackson.core.io

public final Class BigDecimalParser

extends Object
Class Inheritance
Imports
ch.randelshofer.fastdoubleparser.JavaBigDecimalParser, java.math.BigDecimal

Internal Jackson Helper class used to implement more optimized parsing of BigDecimal for REALLY big values (over 500 characters).

This class is not meant to be used directly. It is designed to be used by Jackson JSON parsers (and parsers for other Jackson supported data formats). The parsers check for invalid characters and the length of the number. Without these checks, this parser is susceptible to performing badly with invalid inputs. If you need to parse numbers directly, please use JavaBigDecimalParser in fastdoubleparser instead.

Based on ideas from this this git commit.

Since
2.13

Field Summary

Modifier and TypeField and Description
pack-priv static final int
private static final int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static String
_generateExceptionMessage(final String valueToReport, final String desc)

private static String
_getValueDesc(final String fullValue)

private static String
_getValueDesc(final char[] array, final int offset, final int len)

private static NumberFormatException
private static NumberFormatException
_parseFailure(final Exception e, final char[] array, final int offset, final int len)

public static BigDecimal

Returns:

BigDecimal value
parse
(String valueStr)

Internal Jackson method.

public static BigDecimal

Returns:

BigDecimal value
parse
(final char[] chars, final int off, final int len)

Internal Jackson method.

public static BigDecimal

Returns:

BigDecimal value
parse
(char[] chars)

Internal Jackson method.

public static BigDecimal

Returns:

BigDecimal value
parseWithFastParser
(final String valueStr)

Internal Jackson method.

public static BigDecimal

Returns:

BigDecimal value
parseWithFastParser
(final char[] ch, final int off, final int len)

Internal Jackson method.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

MAX_CHARS_TO_REPORTback to summary
pack-priv static final int MAX_CHARS_TO_REPORT
SIZE_FOR_SWITCH_TO_FASTDOUBLEPARSERback to summary
private static final int SIZE_FOR_SWITCH_TO_FASTDOUBLEPARSER

Constructor Detail

BigDecimalParserback to summary
private BigDecimalParser()

Method Detail

_generateExceptionMessageback to summary
private static String _generateExceptionMessage(final String valueToReport, final String desc)
_getValueDescback to summary
private static String _getValueDesc(final String fullValue)
_getValueDescback to summary
private static String _getValueDesc(final char[] array, final int offset, final int len)
_parseFailureback to summary
private static NumberFormatException _parseFailure(Exception e, String fullValue)
_parseFailureback to summary
private static NumberFormatException _parseFailure(final Exception e, final char[] array, final int offset, final int len)
parseback to summary
public static BigDecimal parse(String valueStr)

Internal Jackson method. Please do not use.

Note

Caller MUST pre-validate that given String represents a valid representation of BigDecimal value: parsers in jackson-core do that; other code must do the same.

Returns:BigDecimal

BigDecimal value

parseback to summary
public static BigDecimal parse(final char[] chars, final int off, final int len)

Internal Jackson method. Please do not use.

Note

Caller MUST pre-validate that given String represents a valid representation of BigDecimal value: parsers in jackson-core do that; other code must do the same.

Returns:BigDecimal

BigDecimal value

parseback to summary
public static BigDecimal parse(char[] chars)

Internal Jackson method. Please do not use.

Note

Caller MUST pre-validate that given String represents a valid representation of BigDecimal value: parsers in jackson-core do that; other code must do the same.

Returns:BigDecimal

BigDecimal value

parseWithFastParserback to summary
public static BigDecimal parseWithFastParser(final String valueStr)

Internal Jackson method. Please do not use.

Note

Caller MUST pre-validate that given String represents a valid representation of BigDecimal value: parsers in jackson-core do that; other code must do the same.

Returns:BigDecimal

BigDecimal value

parseWithFastParserback to summary
public static BigDecimal parseWithFastParser(final char[] ch, final int off, final int len)

Internal Jackson method. Please do not use.

Note

Caller MUST pre-validate that given String represents a valid representation of BigDecimal value: parsers in jackson-core do that; other code must do the same.

Returns:BigDecimal

BigDecimal value