You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@johnzon.apache.org by Romain Manni-Bucau <rm...@gmail.com> on 2016/04/27 15:56:46 UTC

ObjectConverter API

Do we miss writeArray API? think so otherwise it is hard to create a
virtual list

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

Re: ObjectConverter API

Posted by Romain Manni-Bucau <rm...@gmail.com>.
the use case is to expose in JSON a different structure than the object
(saw object being seens as arrays)

or simply: handler.writeArray(asList(new Property("name", user.getName(),
new Property("id", user.getId())) using a UserPropertyListConverter front
oriented (to match a front framework).



Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-04-28 19:04 GMT+02:00 Reinhard Sandtner <re...@gmail.com>:

> hey,
>
> sry for the late response but your mail was in my spam folder grrrrrr :(
>
> do we really need writeArray? internal we only need writeObject and check
> if it’s a Collection or Array afaik...
>
> what’s the use case for virtual list? do we have a unit test which i can
> use as sample to try it with ObjectConverter?
>
> lg
> reini
>
>
> > Am 27.04.2016 um 15:56 schrieb Romain Manni-Bucau <rmannibucau@gmail.com
> >:
> >
> > Do we miss writeArray API? think so otherwise it is hard to create a
> > virtual list
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <http://rmannibucau.wordpress.com> | Github <
> https://github.com/rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> > <http://www.tomitribe.com> | JavaEE Factory
> > <https://javaeefactory-rmannibucau.rhcloud.com>
>
>

Re: ObjectConverter API

Posted by Reinhard Sandtner <re...@gmail.com>.
hey,

sry for the late response but your mail was in my spam folder grrrrrr :(

do we really need writeArray? internal we only need writeObject and check if it’s a Collection or Array afaik...

what’s the use case for virtual list? do we have a unit test which i can use as sample to try it with ObjectConverter?

lg
reini


> Am 27.04.2016 um 15:56 schrieb Romain Manni-Bucau <rm...@gmail.com>:
> 
> Do we miss writeArray API? think so otherwise it is hard to create a
> virtual list
> 
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> <http://www.tomitribe.com> | JavaEE Factory
> <https://javaeefactory-rmannibucau.rhcloud.com>