Skip to content

Commit 9e308ea

Browse files
authored
update javadoc to highlight that this class is for internal jackson use (#1156)
1 parent ff57898 commit 9e308ea

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

src/main/java/com/fasterxml/jackson/core/io/BigDecimalParser.java

+30-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,20 @@
1212
// https://github.com/eobermuhlner/big-math/commit/7a5419aac8b2adba2aa700ccf00197f97b2ad89f
1313

1414
/**
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>
1724
*<p>
1825
* Based on ideas from this
1926
* <a href="https://github.com/eobermuhlner/big-math/commit/7a5419aac8b2adba2aa700ccf00197f97b2ad89f">this
2027
* git commit</a>.
28+
*</p>
2129
*
2230
* @since 2.13
2331
*/
@@ -27,10 +35,23 @@ public final class BigDecimalParser
2735

2836
private BigDecimalParser() {}
2937

38+
/**
39+
* Internal Jackson method. Please do not use.
40+
*
41+
* @param valueStr
42+
* @return BigDecimal value
43+
* @throws NumberFormatException
44+
*/
3045
public static BigDecimal parse(String valueStr) {
3146
return parse(valueStr.toCharArray());
3247
}
3348

49+
/**
50+
* Internal Jackson method. Please do not use.
51+
*
52+
* @return BigDecimal value
53+
* @throws NumberFormatException
54+
*/
3455
public static BigDecimal parse(final char[] chars, final int off, final int len) {
3556
try {
3657
if (len < 500) {
@@ -58,6 +79,13 @@ public static BigDecimal parse(final char[] chars, final int off, final int len)
5879
}
5980
}
6081

82+
/**
83+
* Internal Jackson method. Please do not use.
84+
*
85+
* @param chars
86+
* @return BigDecimal value
87+
* @throws NumberFormatException
88+
*/
6189
public static BigDecimal parse(char[] chars) {
6290
return parse(chars, 0, chars.length);
6391
}

0 commit comments

Comments
 (0)