Skip to content

Add JsonGenerator.copyCurrentEventExact as alternative to copyCurrentEvent() #984

@cowtowncoder

Description

@cowtowncoder

(note: this will replace #730 )

There is an existing problem with JsonGenerator.copyCurrentEvent() as explained on issue #730.
Unfortunately changing existing implementation has potential serious downsides for usage with binary backends when translating from textual format like JSON (with possible but not necessarily inexact double vs accurate BigDecimal) into binary format like CBOR, where latter may desire to just use double (or float) value.

Since we do want to offer a way for 100% accuracy-retaining method, it seems safer to introduce a new method as an alternative so caller can specify exactly what to optimize for -- existing method follows whatever JsonParser.getNumberType() claims is the optimal representation; new method will instead use JsonParser.getNumberValueExact().

NOTE: we may consider in near future possibly to add JsonGenerator.copyCurrentStructureExact(), but initial work is just for copyCurrentEventExact().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions