Code Monkey home page Code Monkey logo

Comments (7)

rtmvc avatar rtmvc commented on June 8, 2024

I stumbled into the same problem. The only way I found to generalize this easily is to use a "closure" although that's not satisfactory.
I guess a good way to make it possible would be either to generate a specific method for each Parser or to make them implement a kind of interface with the method parseFromJson().

from ig-json-parser.

rtmvc avatar rtmvc commented on June 8, 2024

In case someone needs it, I've created a small gist to help parse a JSON stream knowing its corresponding Java class: https://gist.github.com/ratamovic/c6497504cd8edf87ef38

from ig-json-parser.

ttung avatar ttung commented on June 8, 2024

this is a good start though be aware that this is not proguard safe.

from ig-json-parser.

willyantows avatar willyantows commented on June 8, 2024

Where I can find example how to use ParserHelper class?
I found the same problem to serialization/deserialization of top level arrays.

from ig-json-parser.

 avatar commented on June 8, 2024

Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

from ig-json-parser.

asarazan avatar asarazan commented on June 8, 2024

Looks like this issue has been abandoned. Any update here? It'd be hugely valuable to have. Can also try to dig in and PR a fix with a little guidance.

from ig-json-parser.

ttung avatar ttung commented on June 8, 2024

A pretty bad¹ but easy solution to whip up:
Parse {"dummy_key": YOUR_JSON_ARRAY}.

A slightly less bad solution, but somewhat more complicated solution:
Subclass JsonParser, inject in the tokens to create the same sequence of tokens as above.

The best solution is native support in the library, but I have a different day job now. :/

¹ it's bad because it involves allocating a chunk of memory roughly equal to the length of your string.

from ig-json-parser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.