pascallouisperez / jsonmarshaller

JsonMarshaller is a Java 1.5 library that allows marshalling and unmarshalling of JSON objects to and from entities ("Java classes").
Apache License 2.0
1 stars 0 forks source link

Streaming support for unmarshallList (feature request) #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It would be great if the jsonmarshaller provided some form of support for
unmarshalling streams.

This is one way I could see this working:

For the input:
[
{"type": "foo", "fooValue": 1},
//pause
{"type": "bar", "barValue": "abc"},
//pause
{"type": "baz", "bazValue": false}
]

Code along these lines would provide streaming unmarshalling:

InputStream is = //...;
TwoLattes.createMarshaller(FooBarBaz.class).streamingUnmarshallList(is, 
  new EntityCallback<FooBarBaz>() {
    void callback(FooBarBaz entity) { 
      //yields individual instances of FooBarBaz from the provided input stream
    }
  });

Original issue reported on code.google.com by dfortun...@gmail.com on 21 Apr 2010 at 9:44

GoogleCodeExporter commented 9 years ago

Original comment by julien.w...@gmail.com on 27 Apr 2010 at 1:07