Project

General

Profile

Download (1.18 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2018 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.taxeditor.view.webimport.termimport.parser;
10

    
11
import org.json.JSONArray;
12
import org.json.JSONException;
13
import org.json.JSONObject;
14

    
15
/**
16
 * @author pplitzner
17
 * @since May 31, 2018
18
 *
19
 */
20
public class ParserUtil {
21

    
22
    public static JSONArray parseResults(JSONObject jsonObject) throws JSONException{
23
        return jsonObject.getJSONArray("results");
24
    }
25

    
26
    public static String parseUri(JSONObject jsonObject) throws JSONException{
27
        return jsonObject.getString("uri");
28
    }
29

    
30
    public static String parseLabel(JSONObject jsonObject) throws JSONException{
31
        return jsonObject.getString("label");
32
    }
33

    
34
    public static String parseDescription(JSONObject jsonObject) throws JSONException{
35
        return jsonObject.getString("description");
36
    }
37

    
38
    public static String parseTerminology(JSONObject jsonObject) throws JSONException {
39
        return jsonObject.getString("sourceTerminology");
40
    }
41
}
(3-3/6)