12
12
// https://github.com/eobermuhlner/big-math/commit/7a5419aac8b2adba2aa700ccf00197f97b2ad89f
13
13
14
14
/**
15
- * Helper class used to implement more optimized parsing of {@link BigDecimal} for REALLY
16
- * big values (over 500 characters)
15
+ * Internal Jackson Helper class used to implement more optimized parsing of {@link BigDecimal} for REALLY
16
+ * big values (over 500 characters).
17
+ *<p>
18
+ * This class is not meant to be used directly. It is designed to be used by Jackson JSON parsers (and parsers
19
+ * for other Jackson supported data formats). The parsers check for invalid characters and the length of the number.
20
+ * Without these checks, this parser is susceptible to performing badly with invalid inputs. If you need to parse
21
+ * numbers directly, please use JavaBigDecimalParser in <a href="https://github.com/wrandelshofer/FastDoubleParser">fastdoubleparser</a>
22
+ * instead.
23
+ *</p>
17
24
*<p>
18
25
* Based on ideas from this
19
26
* <a href="https://github.com/eobermuhlner/big-math/commit/7a5419aac8b2adba2aa700ccf00197f97b2ad89f">this
20
27
* git commit</a>.
28
+ *</p>
21
29
*
22
30
* @since 2.13
23
31
*/
@@ -27,10 +35,23 @@ public final class BigDecimalParser
27
35
28
36
private BigDecimalParser () {}
29
37
38
+ /**
39
+ * Internal Jackson method. Please do not use.
40
+ *
41
+ * @param valueStr
42
+ * @return BigDecimal value
43
+ * @throws NumberFormatException
44
+ */
30
45
public static BigDecimal parse (String valueStr ) {
31
46
return parse (valueStr .toCharArray ());
32
47
}
33
48
49
+ /**
50
+ * Internal Jackson method. Please do not use.
51
+ *
52
+ * @return BigDecimal value
53
+ * @throws NumberFormatException
54
+ */
34
55
public static BigDecimal parse (final char [] chars , final int off , final int len ) {
35
56
try {
36
57
if (len < 500 ) {
@@ -58,6 +79,13 @@ public static BigDecimal parse(final char[] chars, final int off, final int len)
58
79
}
59
80
}
60
81
82
+ /**
83
+ * Internal Jackson method. Please do not use.
84
+ *
85
+ * @param chars
86
+ * @return BigDecimal value
87
+ * @throws NumberFormatException
88
+ */
61
89
public static BigDecimal parse (char [] chars ) {
62
90
return parse (chars , 0 , chars .length );
63
91
}
0 commit comments