Class BigDecimalParser
- java.lang.Object
-
- com.fasterxml.jackson.core.io.BigDecimalParser
-
public final class BigDecimalParser extends java.lang.ObjectInternal Jackson Helper class used to implement more optimized parsing ofBigDecimalfor 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
Fields Modifier and Type Field Description (package private) static intMAX_CHARS_TO_REPORT
-
Constructor Summary
Constructors Modifier Constructor Description privateBigDecimalParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.lang.String_generateExceptionMessage(java.lang.String valueToReport, java.lang.String desc)private static java.lang.String_getValueDesc(char[] array, int offset, int len)private static java.lang.String_getValueDesc(java.lang.String fullValue)private static java.lang.NumberFormatException_parseFailure(java.lang.Exception e, char[] array, int offset, int len)private static java.lang.NumberFormatException_parseFailure(java.lang.Exception e, java.lang.String fullValue)static java.math.BigDecimalparse(char[] chars)Internal Jackson method.static java.math.BigDecimalparse(char[] chars, int off, int len)Internal Jackson method.static java.math.BigDecimalparse(java.lang.String valueStr)Internal Jackson method.static java.math.BigDecimalparseWithFastParser(char[] ch, int off, int len)Internal Jackson method.static java.math.BigDecimalparseWithFastParser(java.lang.String valueStr)Internal Jackson method.
-
-
-
Field Detail
-
MAX_CHARS_TO_REPORT
static final int MAX_CHARS_TO_REPORT
- See Also:
- Constant Field Values
-
-
Method Detail
-
parse
public static java.math.BigDecimal parse(java.lang.String valueStr)
Internal Jackson method. Please do not use.Note: Caller MUST pre-validate that given String represents a valid representation of
BigDecimalvalue: parsers injackson-coredo that; other code must do the same.- Parameters:
valueStr-- Returns:
- BigDecimal value
- Throws:
java.lang.NumberFormatException
-
parse
public static java.math.BigDecimal parse(char[] chars, int off, int len)Internal Jackson method. Please do not use.Note: Caller MUST pre-validate that given String represents a valid representation of
BigDecimalvalue: parsers injackson-coredo that; other code must do the same.- Returns:
- BigDecimal value
- Throws:
java.lang.NumberFormatException
-
parse
public static java.math.BigDecimal parse(char[] chars)
Internal Jackson method. Please do not use.Note: Caller MUST pre-validate that given String represents a valid representation of
BigDecimalvalue: parsers injackson-coredo that; other code must do the same.- Parameters:
chars-- Returns:
- BigDecimal value
- Throws:
java.lang.NumberFormatException
-
parseWithFastParser
public static java.math.BigDecimal parseWithFastParser(java.lang.String valueStr)
Internal Jackson method. Please do not use.Note: Caller MUST pre-validate that given String represents a valid representation of
BigDecimalvalue: parsers injackson-coredo that; other code must do the same.- Parameters:
valueStr-- Returns:
- BigDecimal value
- Throws:
java.lang.NumberFormatException
-
parseWithFastParser
public static java.math.BigDecimal parseWithFastParser(char[] ch, int off, int len)Internal Jackson method. Please do not use.Note: Caller MUST pre-validate that given String represents a valid representation of
BigDecimalvalue: parsers injackson-coredo that; other code must do the same.- Returns:
- BigDecimal value
- Throws:
java.lang.NumberFormatException
-
_parseFailure
private static java.lang.NumberFormatException _parseFailure(java.lang.Exception e, java.lang.String fullValue)
-
_parseFailure
private static java.lang.NumberFormatException _parseFailure(java.lang.Exception e, char[] array, int offset, int len)
-
_getValueDesc
private static java.lang.String _getValueDesc(java.lang.String fullValue)
-
_getValueDesc
private static java.lang.String _getValueDesc(char[] array, int offset, int len)
-
_generateExceptionMessage
private static java.lang.String _generateExceptionMessage(java.lang.String valueToReport, java.lang.String desc)
-
-