Project

General

Profile

« Previous | Next » 

Revision b1d7bf10

Added by Patrick Plitzner almost 6 years ago

ref #7362 Refactor json parser + add term request

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/webimport/termimport/parser/TerminologyParser.java
30 30
            JSONObject jsonResponse = new JSONObject(response);
31 31
            JSONArray responseArray = jsonResponse.getJSONArray("results");
32 32
            for(int i=0;i<responseArray.length();i++){
33
                JSONObject terminology = responseArray.getJSONObject(i);
34
                String name = terminology.getString("name");
35
                String acronym = terminology.getString("acronym");
36
                String description = terminology.getString("description");
37
                String uriString = terminology.getString("uri");
38
                wrapperList.add(new TerminologyWrapper(name, acronym, description, uriString));
33
                JSONObject jsonObject = responseArray.getJSONObject(i);
34
                String name = jsonObject.getString("name");
35
                String acronym = jsonObject.getString("acronym");
36
                String description = ParserUtil.parseDescription(jsonObject);
37
                String uri = ParserUtil.parseUri(jsonObject);
38
                wrapperList.add(new TerminologyWrapper(name, acronym, description, uri));
39 39
            }
40 40
        } catch (JSONException e) {
41 41
            e.printStackTrace();

Also available in: Unified diff