users@jersey.java.net

[Jersey] Re: Encoding longs ...

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Mon, 8 Jul 2013 19:08:56 -0700

Oh. Must be some oddity with natural notation then? I would check out POJO
mapping.

-+ Tatu +-


On Mon, Jul 8, 2013 at 5:03 PM, Brian Mason <brian_at_gabey.com> wrote:

> It is rounded to the precision json supports. 54 bits
> On Jul 8, 2013 4:40 PM, "Tatu Saloranta" <tsaloranta_at_gmail.com> wrote:
>
>> What do you mean by truncation?
>>
>> -+ Tatu +-
>>
>>
>> On Mon, Jul 8, 2013 at 2:56 PM, Brian Mason <brian_at_gabey.com> wrote:
>>
>>> Actually I did a quick test and the BigDecimal is renders as a long as
>>> well and truncated.
>>>
>>>
>>>
>>> On Mon, Jul 8, 2013 at 2:10 PM, Brian Mason <brian_at_gabey.com> wrote:
>>>
>>>> Thanks,
>>>> Is there a way to automate a runtime conversion of longs to Big
>>>> Decimals or is that just something I should have coded up when I did the
>>>> coding???
>>>>
>>>> Brian
>>>>
>>>>
>>>> On Mon, Jul 8, 2013 at 12:27 PM, Tatu Saloranta <tsaloranta_at_gmail.com>wrote:
>>>>
>>>>> Usually lossless handling is achieved best by using `BigDecimal` for
>>>>> values.
>>>>> Jackson-based "POJO" mapping will handle this fine; although best
>>>>> practices suggest you should send this as part of an Object, as root-level
>>>>> values are not officially legal JSON.
>>>>>
>>>>> -+ Tatu +-
>>>>>
>>>>>
>>>>>
>>>>> On Mon, Jul 8, 2013 at 9:54 AM, Brian Mason <brian_at_gabey.com> wrote:
>>>>>
>>>>>> I am still on 1.17
>>>>>> I am using "Natural" encoding but I want to override the long
>>>>>> encoding to make it a string so we dont loose digits when its encoded to
>>>>>> JSON.
>>>>>> Any suggestions on how to do this (Or a better idea of how to do
>>>>>> this?)
>>>>>>
>>>>>> Thanks,
>>>>>> Brian Mason
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>