File tree Expand file tree Collapse file tree
src/main/java/com/fasterxml/jackson/annotation Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 *<p>
2020 * As of Jackson 2.20, known special handling includes:
2121 *<ul>
22- * <li>{@link java.util.Date} or {@link java.util.Calendar}: Shape can be {@link Shape#STRING} or {@link Shape#NUMBER};
22+ * <li>{@link java.util.Date} or {@link java.util.Calendar}: Shape can be {@link Shape#STRING} or {@link Shape#NUMBER};
2323 * pattern may contain {@link java.text.SimpleDateFormat}-compatible pattern definition.
2424 * </li>
2525 * <li>{@code java.time.*}: Types in the {@code java.time} package can use
4141 * if {@link Shape#OBJECT} is used. NOTE: can ONLY be used as class annotation;
4242 * will not work as per-property annotation.
4343 * </li>
44- * <li>{@link java.lang.Number} subclasses can be serialized as full objects if
45- * {@link Shape#OBJECT} is used. Otherwise the default behavior of serializing to a
46- * scalar number value will be preferred. NOTE: can ONLY be used as class annotation;
47- * will not work as per-property annotation.
44+ * <li>{@link java.lang.Number} subclasses can use {@link Shape#STRING} to serialize to a string.
45+ * This is useful to prevent large numeric values from being rounded to their closest double
46+ * values when deserialized by JSON parsers (for instance <code>JSON.parse()</code> in web
47+ * browsers) that do not support numbers with more than 53 bits of precision.
48+ * <p>
49+ * They can also be serialized to full objects if {@link Shape#OBJECT} is used.
50+ * Otherwise, the default behavior of serializing to a scalar number value will be preferred.
51+ * NOTE: can ONLY be used as class annotation; will not work as per-property annotation.
4852 * </li>
4953 *</ul>
5054 *
You can’t perform that action at this time.
0 commit comments