protected static List<String> parseMandatoryStringValues(JSONObject json, String key) throws JSONException {

        List<String> list = null;
        JSONArray array = json.getJSONArray(key);
        list = new ArrayList<String>(array.length());
        for (int i = 0; i < array.length(); i++) {
            try {
                String entry = array.getString(i);
                list.add(entry);
            } catch (JSONException e) {
                LOG.info(Messages.get().getBundle().key(Messages.LOG_OPTIONAL_STRING_ENTRY_UNPARSABLE_1, key), e);
            }
        }
        return list;
    }
protected static List < String > parseMandatoryStringValues ( JSONObject json , String key ) throws JSONException { List < String > list = null ; JSONArray array = json . getJSONArray ( key ) ; list = new ArrayList < String > ( array . length ( ) ) ; for ( int i = 0 ; i < array . length ( ) ; i ++ ) { try { String entry = array . getString ( i ) ; list . add ( entry ) ; } catch ( JSONException e ) { LOG . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_OPTIONAL_STRING_ENTRY_UNPARSABLE_1 , key ) , e ) ; } } return list ; }
Helper for reading a mandatory String value list - throwing an Exception if parsing fails.
@param json The JSON object where the list should be read from.
@param key The key of the value to read.
@return The value from the JSON.
@throws JSONException thrown when parsing fails.