Comments (8)
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 google-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 google-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 google-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 google-gson.
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 google-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 google-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 google-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 google-gson.
Related Issues (20)
- StackOverflowError with Java 1.8 using toJason on a object containing a KeyEvent
- Documentation missing for built-in serializers
- java.io.NotSerializableException: com.google.gson.internal.LinkedTreeMap$1 HOT 2
- StackOverFlow while converting a null object to json
- Correct JsonWriter class-level Javadoc
- Error desirialization of ConcurrentNavigableMap
- FutureTypeAdapter.read() throws unhelpful exception HOT 2
- Patch for /trunk/gson/src/main/java/com/google/gson/JsonDeserializer.java
- LazilyParsedNumber does not implement eqals and hashCode methods HOT 2
- private inheritance
- convert string to JSON with special character \u
- JsonElement's getAsInt() doesn't throw an Error when converting an too big exponential value HOT 1
- phone
- UI ISSUE IN DROPDOWN LIST
- Disable @SerializedName usage via GsonBuilder
- Gson not populating fields on Object created with InstanceCreator
- Support Java 8 time: Instant, LocalDate, LocalTime, ZonedDateTime ...
- lenient flag ignored in JsonWriter#value(double)
- Track source location for JsonElement
- Can we have feature to access child directly using SerializedName?
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 google-gson.