This question has already been answered:

{ "company": { "name":"High Technologies Center", "age": "15", "competences": ["Android", "IOS", ".NET", "PHP", "Smart-TV"], "employees": [{ "name": "John", "phone_number": "769453", "skills": ["Java", "Android"] }, { "name": "Diego", "phone_number": "987924", "skills": ["Java", "Smart-TV"] }, { "name": "Alfred", "phone_number": "452533", "skills": ["Objective-C", "Android", "Photoshop"] }, { "name": "John", "phone_number": "212456", "skills": ["Java", "Phython"] }, { "name": "Mat", "phone_number": "778975", "skills": ["Android", "MovieMaker"] }, { "name": "Bob", "phone_number": "456468", "skills": ["Groovy", "Kotlin"] }, { "name": "Marty", "phone_number": "321789", "skills": ["Android", "PHP", "C#"] }] } } 

Reported as a duplicate by participants Enikeyschik , YuriySPb java Mar 22 at 10:41 am

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

    1 answer 1

    1. You chase your JSON at http://www.jsonschema2pojo.org/ and get Java classes that you then import into your project. 2. Get the object with the command

     Gson gson = new Gson(); Entity read = gson.fromJson(json, Entity.class); 

    Details: http://www.javenue.info/post/gson-json-api

    • Specify more precisely where to import them. And what entity did you use? - Alexey Krasnov
    • Entity - This is a class that was zageneren with jsonschema2pojo.org - Xoxole
    • In the project, create a package for your entities. When you generate on the site there is a Package field, enter the name of your package in it. After generation will place .java files in this package in the project. - Xoxole