Giter Club home page Giter Club logo

Comments (7)

wonderfly avatar wonderfly commented on September 4, 2024

From [email protected] on August 29, 2011 11:11:43

Note that the limitation with erasure in Java is that all generic type information is lost, so we would end up parsing essentially into List, much like when we parse Map, we are parsing essentially into Map<Object, Object>.

Currently we are assuming that the parse method is parsing a JSON object, not a JSON array. So this feature request is to expand its use to also supporting parsing JSON array. There is a separate method called parseArray that is better than parse because it gives the generic type as a parameter when that is known.

Note also that this only applies when parsing directly into a List. If there is a field in an object we are parsing into of type List, this already works correctly today.

Summary: Parsing directly into a List
Status: Accepted
Labels: Milestone-Version1.7.0

from google-http-java-client.

wonderfly avatar wonderfly commented on September 4, 2024

From [email protected] on August 29, 2011 11:11:56

Labels: Component-JSON

from google-http-java-client.

wonderfly avatar wonderfly commented on September 4, 2024

From [email protected] on February 28, 2012 17:15:12

Labels: -Milestone-Version1.7.0 Milestone-Version1.8.0

from google-http-java-client.

wonderfly avatar wonderfly commented on September 4, 2024

From [email protected] on March 27, 2012 07:22:33

Labels: Milestone-Version1.9.0

from google-http-java-client.

wonderfly avatar wonderfly commented on September 4, 2024

From [email protected] on May 14, 2012 07:14:07

Labels: -Milestone-Version1.9.0 Milestone-Version1.10.0

from google-http-java-client.

wonderfly avatar wonderfly commented on September 4, 2024

From [email protected] on June 08, 2012 04:47:27

Labels: -Milestone-Version1.10.0 Milestone-Version1.11.0

from google-http-java-client.

wonderfly avatar wonderfly commented on September 4, 2024

From [email protected] on June 08, 2012 05:24:06

We've implemented the ability to parse into any Type now so that we can properly parse into List for example. You can use TypeToken from gson for this. Alternatively, just call parseArray. It's not a pretty situation, but hopefully it suffices for the power user like Alon. Marking as "Fixed" for now, but please let me know if you have any idea for improvement.

Status: Fixed
Cc: [email protected]
Labels: -Milestone-Version1.11.0 Milestone-Version1.10.0

from google-http-java-client.

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.