简体   繁体   中英

Generate Java objects from JSON

I need to generate a Java class from a JSON response recieved from a web service. I've used JAXB to handle xml, but I don't know how to handle JSON. Does anyone know if a tool exists for this job? Thanks.

ps: I need to generate new classes, not convert classes.

Jackson is a good library. Give it a try.

Going to go ahead and say that GSON ( http://code.google.com/p/google-gson/ ) is a lot more user friendly albeit less powerful than Jackson. If you're just getting started with this stuff I'm willing to bet that GSON will give you far less headaches and be closer to what you really want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM