Comments (8)
Just a suggestion: make it "pull" variety (~= stax), since it is trivial to
invert
Stax to produce SAX-like events (so "SAX" part can build on lower-level "Stax"
part).
The reverse is not generally possible without multi-threading (or language
support
for co-procedures/closures).
Original comment by [email protected]
on 11 Aug 2008 at 10:30
from gson.
Would this be served by providing a hook to plug-in a different JSON parser?
Can you give us some concrete examples of where this will be useful? You can use
custom serializer/deserializers to do the customized handling anyway. But you
are
right, our parser creates the parse tree first, so can choke on very large
input.
Original comment by inder123
on 4 Aug 2008 at 6:44
from gson.
http://www.cowtowncoder.com/hatchery/jackson/index.html
I am using JSON-lib and looking for a better one. I myself like upper lib so far
since it supply a Streaming API which allows to process huge data. But then I
found
your lib, which is also a nice one expect do not support Streaming API. I think
which
would be a highlight if you can add it in.
When I said customize the parsing, I mean you could supply event like SAX do,
so I
can create new instance or set value according to the events.
I do not how to do these because I do not know parsing algorithm. But I wish to
supply some idea to make gson better.
Thanks,
Jiming
Original comment by [email protected]
on 5 Aug 2008 at 3:09
from gson.
We thought more about it, and it seems that this is worth doing since it will
enable
Gson to process really large documents. We will essentially have to rewrite our
parser to either support SAX (event based) or StAX (Streaming based) parsing.
This
can probably be done by modifying our JavaCC grammar itself. This is a major
undertaking, but we will consider this for one of our major releases.
Original comment by inder123
on 5 Aug 2008 at 6:12
- Changed state: Accepted
- Added labels: Type-Enhancement
- Removed labels: Type-Defect
from gson.
Great to hear that!
Thanks and looking forward to that.
Jiming
Original comment by [email protected]
on 6 Aug 2008 at 2:19
from gson.
Hi I just ran into this issue as well. Any timeline for when issue 28 will be
addressed?
Original comment by [email protected]
on 21 Nov 2008 at 4:56
from gson.
Well, I looked into rewriting our JavaCC parser to be a SAX or pull-based one,
and
was not terribly successful. At this time, we have put this on hold. If someone
can
point us to a third-party SAX/pull parser that we can adapt, we will consider
using
it. Or better, help us write one.
This will likely have an impact on the backward compatibility. However, that is
something we can carefully weigh on.
Original comment by inder123
on 22 Nov 2008 at 2:15
from gson.
We dont have SAX like functions, but Gson 1.4 adds a JsonParserAsync class that
lets
you parse multiple JSON objects on a stream.
Overall, backwards compatibility is quite important for us, so I dont see us
breaking
that in favor of a SAX like parser (which is in general harder to use).
Original comment by inder123
on 1 Oct 2009 at 4:01
- Changed state: WontFix
from gson.
Related Issues (20)
- @SerializedName not working HOT 12
- Request to enhance some tests performance to avoid random getDeclaredFields() results HOT 3
- gson-2.10.1 failed with jdk:21 (test phase): "Tests run: 1231, Failures: 8" HOT 7
- Bug Parse Date 1966-11-01 HOT 4
- `DateFormat` time zone is not restored after parsing, affecting subsequent serialization HOT 2
- Internal packages are not exported in OSGI jar HOT 1
- Parse nested json into flat model class objects HOT 1
- Generic deserializer should extract type information from generic boundary HOT 15
- L
- Yep
- Hua HOT 1
- fromJson(String json, Class<T> classOfT) throws JsonSyntaxException is not thawing exception HOT 1
- 打个广告 gson 10倍速度提升 https://github.com/NBXXF/gson_plugin HOT 1
- About gson multiple field conflict error reporting HOT 1
- Using gson to deserialize error reporting, the gson version I use is 2.10.1 HOT 4
- Why can't Gson serialize the value of the scala.collection.immutable.Map type member variable of the case class into a JSON string,while java.util.HashMap is ok? HOT 1
- Add jackson-databind license header to `ISO8601Utils` and `UtcDateTypeAdapter` HOT 2
- Possible typo at gson readme.md in main branch HOT 2
- Javascript HOT 22
- Gson cannot serialize subclass who override a field HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gson.