Serialzing objects using Piriti

15 views
Skip to first unread message

dflorey

unread,
Jul 3, 2010, 8:03:33 AM7/3/10
to Piriti
Hi,
I'm looking for a library that can help me to serialize/deserialize
objects to string on the client side.
I'd like to able to store object on the client (html5-database) as
strings and get them back.
I guess it is possible to use Piriti to marshall the objects to xml/
json and read them back?
Are there plans to support a condensed format to store objects in a
more efficient manner?

Thanks a lot so far for the nice tool + clean docs!

Daniel

Harald Pehl

unread,
Jul 4, 2010, 2:32:13 PM7/4/10
to Piriti
Hi Daniel,

right now Piriti is a "one-way street". You can parse xml / json and
map them to your POJOs. There are plans to serialize the POJOs to
xml / json, but that might take a while. Currently I'm struggling with
namespace support in IE ;-)

After the release of Piriti 0.4 (with namespace support), I will see
how fast I can implement the serialization to xml / json. Right now I
have no plans for other formats.

- Harald

dflorey

unread,
Jul 5, 2010, 5:14:53 AM7/5/10
to Piriti
Hi Harald,
Thanks for your answer.
I guess for now I'll stick with a simple "toString()" approach that
I'll implement manually to generate json from my gwt/java objects.

Daniel

marius andreiana

unread,
Aug 29, 2010, 6:16:05 AM8/29/10
to Piriti
Hallo,

I'd also like to support this request. Our use case is using GWT with
REST APIs transporting JSON.
We can use piriti now to read the responses, and would also like to
use piriti to compose the requests.

Danke :)

Harald Pehl

unread,
Aug 30, 2010, 3:43:13 AM8/30/10
to Piriti
Hi,

right now the support for serializing to JSON is only in the trunk,
but not available as download. Xml serialization is not yet
implemented. As soon as I finished the documentation for it, there
will be a new version in the downloads. In the meantime feel free to
checkout the sources and build by yourself. You can take a look at the
following unit tests to get a feeling of how the serialization works:

http://code.google.com/p/piriti/source/browse/trunk/core/src/test/java/name/pehl/piriti/client/gwttest/animal/JsonAnimalTest.java
http://code.google.com/p/piriti/source/browse/trunk/core/src/test/java/name/pehl/piriti/client/gwttest/book/JsonBookTest.java
http://code.google.com/p/piriti/source/browse/trunk/core/src/test/java/name/pehl/piriti/client/gwttest/simple/JsonAmoebaWriterTest.java

Bitte schön :)
- Harald

On 29 Aug., 12:16, marius andreiana <marius.andrei...@gmail.com>
wrote:

marius andreiana

unread,
Aug 30, 2010, 5:07:03 PM8/30/10
to Piriti
Vielen Dank Harald!

I also wanted to say Thank you for piriti library. We are starting to
develop an app on top of REST APIs, and after doing the 1st try of
parsing using gwt's JSON support, discovering Piriti was like an
enlightenment :) Now we have clean data models, with no boilerplate
code to parse JSON.


On Aug 30, 10:43 am, Harald Pehl <harald.p...@googlemail.com> wrote:
> Hi,
>
> right now the support for serializing to JSON is only in the trunk,
> but not available as download. Xml serialization is not yet
> implemented. As soon as I finished the documentation for it, there
> will be a new version in the downloads. In the meantime feel free to
> checkout the sources and build by yourself. You can take a look at the
> following unit tests to get a feeling of how the serialization works:
>
> http://code.google.com/p/piriti/source/browse/trunk/core/src/test/jav...http://code.google.com/p/piriti/source/browse/trunk/core/src/test/jav...http://code.google.com/p/piriti/source/browse/trunk/core/src/test/jav...
Reply all
Reply to author
Forward
0 new messages